Nirjhor
(Esoteric Tweeter)
September 13, 2017, 3:14pm
1
I found this plugin called http.cache which seems to be offering caching.
Now when I enabled caching in my Caddyfile, my site looks like a jumbled mess, I think I am missing something, can someone point out what?
junayeed.me:443 {
tls /etc/caddy/ssl/cert_chain.crt /etc/caddy/ssl/junayeed.me.key
root /var/www/wordpress
gzip
cache
fastcgi / /run/php/php7.0-fpm.sock php
rewrite {
if {path} not_match ^\/wp-admin
to {path} {path}/ /index.php?_url={uri}
}
}
Or cache isn’t supposed to work with WordPress?
I’d advise against using http.cache
with WordPress, especially without careful configuration! It will definitely work, but its out-of-the-box behaviour could be disastrous.
To quote myself from an earlier thread on this topic:
To clarify further when it comes to WordPress specifically, and for anyone else reading… I recommend sticking to static assets because, for example, every single page changes when an admin is logged in - a toolbar gets added to the top. Caddy might see this and cache that toolbar even on otherwise static pages.
For those individual pages, I can’t recommend enough using a plugin for WordPress itself - WP Super Cache is a standout example. A smarter cache will know what it should and shouldn’t save. You can cache the static assets at the Caddy layer, as well, for a possible boost there - but let the people who built wordpress.com figure out the more complicated caching policies for you.
2 Likes
Nirjhor
(Esoteric Tweeter)
September 14, 2017, 4:00am
3
Thank you for your reply.
eva2000
(George)
September 19, 2017, 2:44am
4
What about extending http.cache to cache by a key, cookie or to exclude from cache by a key or cookie ?
Sure, that could be feasible. The repository for the cache plugin is here:
At the moment, it looks like it can already be configured to cache by header content. What you’re proposing doesn’t seem too complex.
1 Like
eva2000
(George)
September 19, 2017, 11:01pm
6
Yeah that would be good as it’s feature equivalent to nginx’s proxy_cache and fastcgi_cache supported options. Cloudflare also has for business and enterprise plan clients, bypass cache by cookie as well as cache by key, cookie or by device types
system
(system)
Closed
December 18, 2017, 11:01pm
7
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.