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

[5.x] Prevent protected pages being cached #10929

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

duncanmcclean
Copy link
Member

@duncanmcclean duncanmcclean commented Oct 10, 2024

This pull request fixes an issue where protected pages would be staticly cached, unless manually excluded in the static_caching.php config file.

Closes statamic/ideas#190.

@jasonvarga jasonvarga merged commit 35e57bc into 5.x Oct 18, 2024
17 checks passed
@jasonvarga jasonvarga deleted the prevent-protected-pages-from-being-cached branch October 18, 2024 17:43
@daun
Copy link
Contributor

daun commented Oct 25, 2024

@duncanmcclean Is there a way of reverting to the previous behavior if required? I'm currently relying on caching protected pages in a project. There's a lot of them and the server is really slow :(

@jasonvarga
Copy link
Member

We could, but you're aware of the issue this was fixing, right? They become unprotected once cached.

@daun
Copy link
Contributor

daun commented Oct 25, 2024

@jasonvarga In fact, I wasn't aware. That definitely sounds like something to avoid at all cost. I need to check real quick if the site in question requires a fix on our end in this case 🤠 Looks like it.

The best strategy for caching protected pages would probably be namespacing the cached pages by the user or login state, a bit like the {{ cache scope="user" }} tag would.

@jasonvarga
Copy link
Member

Definitely. I'm sure there's an feature request open already to support that.

@duncanmcclean
Copy link
Member Author

Definitely. I'm sure there's an feature request open already to support that.

There is - go and give statamic/ideas#1234 a 👍.

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

Successfully merging this pull request may close these issues.

Ability to disable half measure / app static caching on protected pages
3 participants