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

Browser HTML cache issues #28

Open
danieliser opened this issue Mar 19, 2020 · 0 comments
Open

Browser HTML cache issues #28

danieliser opened this issue Mar 19, 2020 · 0 comments

Comments

@danieliser
Copy link
Contributor

danieliser commented Mar 19, 2020

Currently page caching leads to stale menu when using the back button after login.

We are exploring options to load it using JavaScript, but it likely won’t happen due to pure implementation barriers. Each theme can customize the output of the menu items with custom classes or even custom html structures. No way (currently known) for us to reliably duplicate that properly for every site, which means it would need to be a one off custom solution for each site.

Possible Solutions

  • Build it 90% and let the user paste in some custom code from their theme to handle actual rendering. This means we fire the AJAX call, load the menu and run it through a custom renderer entered by the user, returning it for rendering in place.
  • Use the jQuery.load() method to refetch the same page with cache buster, returning only the menus we need. Replace them on the page with these. This probably only needs to be done when we detect a stale copy of the page somehow.
  • Add data attribute or classes to each menu item rendered so that we can dynamically remove them using Async JS call to server for login status and permissions.

Workarounds

  • Disabling browser caching of page html on those pages while leaving on server level page caching. This has had decent results with minimal page load impacts as our sites have minimal html and the CSS/JS/Images are still cached in the browser. Not the best option, but a viable one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant