question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Prefetch apis for SPAs

See original GitHub issue

Hey 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:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gilbertococchicommented, Oct 28, 2019

Thanks Alexandre, @thearegee please check this pull request if it would satisfy your needs: https://github.com/GoogleChromeLabs/quicklink/pull/123

0reactions
demianrenzullicommented, Jan 24, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Does prefetch data by Apache before serving a SPA site hurt ...
When a user go to the SPA web, Apache will do authentication and prefetch data for that user by making a POST and...
Read more >
Improving Perceived SPA Performance by Prefetching Critical ...
By prefetching the resource(s) critical to rendering—in this case, the resource for the particular user—we can transition much more seamlessly ...
Read more >
Prefetch to optimize web page speed (SPA) - Stack Overflow
I can push the gallery images to the user list API. But it makes the first page (user list) slower? I have another...
Read more >
Predictive Prefetch js: towards instant loading for React ...
Similar to a recommender system, Predictive Prefetch js learns a user's navigation behavior (within an app) by monitoring the changes in her or ......
Read more >
Adobe Target Delivery API Prefetch
Views support Single Page Applications (SPA) and Mobile Applications more seamlessly. Views can be seen as a logical group of visual elements that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found