[✨] How to distinguish between link preload and page visit #113
Replies: 3 comments
-
|
assigned to @yousefmarey12 (can't do it directly with github for some reason atm) it might be best to send a prefetch header with prefetch calls to detect when requests are only prefetching |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @yousefmarey12 for your research and hard work! @juanpmarin it seems like this requires more investigation, and because we're focused on V2, I suggest we'll evaluate a proper solution for it after V2 is done. In the meantime, what do you say about the following workaround: Something like: That way no javascript will run on initial page load (unlike with visible task which "resumes" and executes its javascript on page load) |
Beta Was this translation helpful? Give feedback.
-
|
We moved this issue to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem?
I'm trying to collect some analytics when a certain page is visited. I'm storing an event every time a routeLoader is executed, but when a Link to that page is hovered, the routeLoader is executed without the user actually visiting the page
Describe the solution you'd like
Be able to distinguish if the current request is a preload or an actual visit to the page, in the routeLoader
Describe alternatives you've considered
Calling a server function from a useVisibleTask$ but seems overkilling
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions