https://htmx.org logo
Join Discord
Powered by
# htmx-general
  • m

    mysterious-toddler-20573

    07/21/2022, 2:51 PM
    yep, new feature, probably a bug
  • m

    mysterious-toddler-20573

    07/21/2022, 5:01 PM
    https://twitter.com/unpolyjs/status/1550019163183357953
  • m

    mysterious-toddler-20573

    07/21/2022, 5:02 PM
    unpoly still crushing
  • p

    powerful-helmet-42757

    07/21/2022, 7:15 PM
    Alright. I think I have an interesting issue here. I'm loading a product cards (each containing an image) in a paginated list (with a "load-more" strategy using
    hx-get
    ). On loading the page, let's say 6 images start to load. Then I hit "load more", 6 new images are added to the network queue. Before everything can finish loading, I hit one of the card, sending me to one of the product page using
    hx-boost
    . Everything works, but looking at the network tab, I can still see chrome trying to load the images from the last page, delaying (I think) the ones from the page I am currently on. I can really see this becoming a bottleneck when loading huge list of items on a poor network. Is there even a way to pause the browser from downloading assets?
  • b

    blue-ghost-19146

    07/21/2022, 7:18 PM
    Would something like
    hx-sync
    help you out? https://htmx.org/attributes/hx-sync/
  • p

    powerful-helmet-42757

    07/21/2022, 7:21 PM
    Seems to be to sync (or queue) stuff INSIDE of HTMX. The problem I see in my use case is that the requests for the assets are already in progress and downloading. It's kind off in the hands of the browser at that point.
  • r

    ripe-action-67367

    07/21/2022, 7:22 PM
    stackoverflow claims that clearing out src attribute should do https://stackoverflow.com/questions/5278304/how-to-cancel-an-image-from-loading
  • r

    ripe-action-67367

    07/21/2022, 7:22 PM
    Not sure how to implement that ergonomically tho
  • p

    powerful-helmet-42757

    07/21/2022, 7:23 PM
    Good start. But then HTMX will cache a page with no image.
  • p

    powerful-helmet-42757

    07/21/2022, 7:23 PM
    I'll have to re-set the src on
    htmx:load
    hoping the browser cache to do it's thing
  • p

    powerful-helmet-42757

    07/21/2022, 7:25 PM
    I'll take a look around other frameworks, try to see if it's an "internet problem" rather then a HTMX one. šŸ˜…
  • p

    powerful-helmet-42757

    07/21/2022, 7:30 PM
    Svelte/Sveltekit seems to be doing the same...
  • p

    powerful-helmet-42757

    07/21/2022, 7:32 PM
    Same for React
  • p

    powerful-helmet-42757

    07/21/2022, 7:32 PM
    well damn. it's an internet thing.
  • m

    mysterious-toddler-20573

    07/21/2022, 7:32 PM
    We are as bad as everyone else šŸŽ‰
  • g

    gorgeous-airport-54386

    07/21/2022, 7:33 PM
    there's a 6 connection limit in http
  • p

    powerful-helmet-42757

    07/21/2022, 7:33 PM
    hehehe well htmx seems to be handling the browser going offline better than Svelte with what Ive been looking at
  • g

    gorgeous-airport-54386

    07/21/2022, 7:33 PM
    (iirc it's actually 2 in the spec but browsers use 6)
  • g

    gorgeous-airport-54386

    07/21/2022, 7:33 PM
    serving http/2 might fix it
  • m

    mysterious-toddler-20573

    07/21/2022, 7:34 PM
    how does deniz know everything
  • p

    powerful-helmet-42757

    07/21/2022, 7:34 PM
    Im already on http2 with Cloudflare. I'm just surprised there is no API to tell the browser to pause a request
  • p

    powerful-helmet-42757

    07/21/2022, 7:37 PM
    I've seriously nerd-snipped myself with this one.
  • p

    powerful-helmet-42757

    07/21/2022, 7:43 PM
    Time to re-read the whole MDN site... Actually, This might be a good use-case for a ServiceWorker. šŸ¤“
  • g

    gorgeous-airport-54386

    07/21/2022, 7:44 PM
    > I can really see this becoming a bottleneck when loading huge list of items on a poor network. are you using
    loading="lazy"
    ?
  • g

    gorgeous-airport-54386

    07/21/2022, 7:45 PM
    might prevent you from loading a huge number of images, hopefully making the bottleneck negligible
  • m

    most-flag-2080

    07/21/2022, 8:01 PM
    anyone try inertiajs?
  • p

    powerful-helmet-42757

    07/21/2022, 8:08 PM
    Yes. But once the request is in flight, there is no canceling it. I'm kinda deep into optimization territory here. The impact is probably negligible for most users, but again I'm not doing it for "most users", I'm kinda aiming for "worst position to be as a user".
  • m

    mysterious-toddler-20573

    07/21/2022, 8:11 PM
    \> not optimizing for running the server locally on your machine because you are a developer šŸ˜
  • p

    powerful-helmet-42757

    07/21/2022, 8:13 PM
    Yeah . I try to optimize for "deep in the wood with a missing limb, bleeding to death with 1% battery and half a bar of 2g signal"
  • m

    mysterious-toddler-20573

    07/21/2022, 8:13 PM
    ah, I see, a fellow montanan
1...757758759...1146Latest