HTTP Cache
Created 6 years ago by ryanthompsonSomething I would like to include in a (now likely) v3.6 is this:
https://github.com/barryvdh/laravel-httpcache#direct-approach-without-serviceprovider
We would need to do it there given that we already handle some middleware and HTTP kernel ourselves. Otherwise nothing breaks but the cache does not come into play.
I feel like this would need an interface of some kind to control? Ideas on controlling this in general.. maybe a filtering system instead of per page/post or the module itself.
I see a system to allow you do do like:
/posts -> 60 minute ttl /posts/* -> 60 minute ttl
/ -> 120 minute ttl
We would need to support ESI and also we would need to come up with a way to dynamically purge cache like model cache collections. Where posts are updated then purge post related URLs.
Any thoughts on how to best handle this? Cachable interface on streams? Idk. Need ideas!
A default value in settings could work - then overridden per module that uses it out of the box? Then per entry we would still need a way to disable it (non-exact URI pages would be tough to purge).
WP Super Cache and Fastest cache seem extremely popular. Maybe I'll wrap those up in here. Take the best of both options / features and smash em together. I feel like needs to go in core because of 1.) how we have to implement it and 2.) tighter internal support for custom addons and such.
I already implemented this one. The problem we will have is: any dynamic area
, need ESI or will not be updated.
Typically for Pyro:
- Token and Form URL
- Block Areas
Anyway, it should be easily disabled on any routes, it cannot be used for eCommerce for example.
Something nice, should be a cache-module
. And inside you can disable / enable cache for all detected routes (need to fix https://github.com/pyrocms/pyrocms/issues/4810#issuecomment-407633454
first). So instead of controlling the cache per module, it can be controller per application.
I'm about to release a 3.6-alpha that includes this as well as docs on customizing timeout and exclusion rules from settings. Works great.
This is in v3.6 - closed.