grav-coder
grav-coder copied to clipboard
Grav menu and cache
Still using this theme with much pleasure :)
You helped me with the log in / log out menu which works great. https://github.com/ParitoshBh/grav-coder/issues/25
The menu is cached though so you tend to see the logged in menu while actually logged out, for example because the session has expired. You will have to F5 the page. Is there a way to prevent this menu from being cached (ESI?) or maybe there is a better way to handle this?
Hmm.. Interesting, I am not sure what a solution might be. I'll have to look through documentation. Will report back with findings.
@Japhys So this appears to be plugin/Grav issue than the theme itself. Refer this thread https://github.com/getgrav/grav-plugin-login/issues/264
It has some potential solutions that you can try.
I quickly tried on my dev instance following config,
expires: 3600
cache_control: 'private, max-age=0, must-revalidate'
etag: true
This seems to work. However, I am no expert and will suggest you do some reading on what these cache control terms mean before using these - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
Thank you very much once again, I'll give it a try this weekend!