Prefetch apis for SPAs
See original GitHub issueHey guys,
First of all thanks for the module, it looks great and something we are really interested in using it. However we have a slightly different request, because our website is an SPA. I’m interested in using it here:
https://www.mrporter.com/en-us/mens/clothing
This could be used for either linking to Product details, or using filters. Ignoring how we detect intention, I’m interested in prefetching data from the relevant api.
This can be interpreted from the products part number or the filters path.
I’ve not had a huge think about how this could be implemented yet, but if for example we might want to be able to have different api prefetches based on an element type:
- Filters elements prefetch
GET /my-filters-endpoint/${filter-id}
- Product elements prefetch
GET /my-product-endpoint/${product-id}
You would need the ability to prefetch based on the element “type”, maybe this could be done with data attributes or configure different quicklink
instances based on The DOM element to observe for in-viewport links to prefetch.
I just wanted to start the conversation, would people be interested in this?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
Thanks Alexandre, @thearegee please check this pull request if it would satisfy your needs: https://github.com/GoogleChromeLabs/quicklink/pull/123
Hi @thearegee, this is an old issue, but #123 has finally landed into the library around October 2020.
From your previous comment it seems like this was everything you needed to make this work. Perhaps others can find your tests useful for similar needs as well.
Closing this one. Please, feel free to reopen if you need anything else.