statamic / ideas

💡Discussions on ideas and feature requests for Statamic
https://statamic.dev
30 stars 1 forks source link

Exclude protected content from the static cache #1019

Closed stuartcusackie closed 3 months ago

stuartcusackie commented 11 months ago

Following on from this conversation.

Protecting content can lead to unexpected results when combined with static caching. For example, you can password protect a page but as soon as you edit it, it becomes public. This is because the page is cached as soon as the authenticated user views it, making it public to non-authenticated users.

The simplest solution is to just exclude protected entries, and similar content, from the static cache, but I wonder if the middleware could be adjusted so that static caching can still be used safely on protected pages.

Thanks.

duncanmcclean commented 3 months ago

Duplicate of #190.