Add an ability to prevent caching file by file#46
Add an ability to prevent caching file by file#46davidyang wants to merge 2 commits intocraftapi:masterfrom
Conversation
|
If you accept something like this I can also add some documentation around it. |
|
It's worth noting that this fix is mostly going to work on account of using No-Cache" (with upper "N" and "C") vs. the default "no-cache" that my dev and production servers were both already sending (and I'm not the only one, apparently - see discussion of session_cache_limiter() here: https://craftcms.stackexchange.com/questions/2598/why-does-craft-set-no-cache-headers-for-all-requests ) Having done a bit of digging, the RFC makes no mention of case sensitivity, but Mozilla is explicitly cool with directives being case-insensitive, however, not all software (such as this change) can be relied on to perform a case-insensitive comparison, so, best practice is probably to use all lower-case. So, in theory this could work, however, it should be updated to be case-insensitive, and, once that happens, it'll effectively prevent this plugin from working with a default (if not optimal) PHP config, and cause headaches for anyone attempting to support it. TL;DR: fixing this so it isn't case sensitive would effectively break the plugin on default PHP configs. |
Hey @craftapi - I haven't coded PHP in years so this is probably not how to do it but I wanted to add a fix so that a user could set a page to not cache using headers.