Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render cached page and check in background if new content is available and (if any) re-render? #93

Closed
frederikhors opened this issue Sep 6, 2019 · 2 comments

Comments

@frederikhors
Copy link

I'm really shocked because I come from Turbolinks and found Unpoly by accident: WONDERFUL! CONGRATULATIONS!

Just one question (coming from Turbolinks): is there a way to load the cached page (just like it happens default way) but check in "background" in parallel for new content on that page and replace the content with new one if available?

From Turbolinks docs (https://github.com/turbolinks/turbolinks/#understanding-caching):

... during standard navigation (via Application Visits), Turbolinks will immediately restore the page from cache and display it as a preview while simultaneously loading a fresh copy from the network. This gives the illusion of instantaneous page loads for frequently accessed locations.

@triskweline
Copy link
Contributor

You can implement this with the JavaScript API, but it doesn't come out of the box.

This is something I would like to see Unpoly support with a convenient modifier like [up-cache=staged]. Any Implementation would need be need to more refined than Turbolinks', since an Unpoly update might only update a fragment, or open the content in a modal layer. Turbolinks 5 always swaps the entire page.

@MSchmidt
Copy link

MSchmidt commented May 5, 2020

Right now the caching system kind of expects that only one user exists. Only clearing the cache after a non-GET request would always render outdated content if someone else made changes to records in the meantime. I think having an improved cache invalidation strategy would be vital.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants