Questions about prefetching #925
-
Describe your problem 🧐Hi, I want to preload pages and show them in a slider (or any other animation).
In addition, I am using data-swup-animation and data-swup-preload on the links outside of the #swup/main container. Most important question now, 1) I have on each side a back-button outside of the swup-container. Every page is fully loaded - but only a smaller fraction is needed to change the content of the swup-container. What is your question? 🙋♀️see above
URL to minimal reproduction 🔗https://projekt-sanierung.de/test_crisis_management_00/ Checked all these? 📚
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
The keep option of the Parallel Plugin keeps the old dom nodes of previous containers around. It has no relation to preloading. Uncommenting/reenabling the preloadVisibleLinks line should do the trick here. If the server is super slow, that will slow it down further, but the solution here would rather be server caching. For updating little things outside of containers, either add those elements to the containers (if they exist on every page) or use the Morph Plugin (can‘t link on mobile, but Google should turn it up). As for the last question: swup requires the full html to be present. Partial payloads are no longer supported since they complicate things (like history navigation and reloads like you mentioned). To speed up the response, it‘s better to look into server caching. |
Beta Was this translation helpful? Give feedback.
-
The reason your pages are preloaded multiple times is that the links are redirected from |
Beta Was this translation helpful? Give feedback.
The reason your pages are preloaded multiple times is that the links are redirected from
/page
to/page/
. Swup currently doesn't cache redirected requests as that would lead to falsely cached data. If you use the correct urls with trailing slash, it should work as expected however.