Cache Everything and Edge Cache TTL of 1 day
I know the following rules are not for everyone but those two are a must for me. Since I host all my files in DigitalOcean Space, when a user request an attachment, the server has to go to the Space bucket, download it and then serve it back to the client. For a lot of my threads, users tend to upload between 10 and 20 images per posts and this would put a pressure to the server that I'm not comfortable with.
So I created this set of rules to fix that problem:
But be warned: any private attachment from private forums and private conversations will be cached as well.
Security High in admin might cause you some problems with saving templates.
I'd disable that rule personally. For security to Admin area, check out Cloudflare Access (free if you need 5 or less people able to get into it).
Avatars and thumbnails have file extensions that are cacheable by Cloudflare, so it's not necessary to create specific page rules for them as long as your web server is configured properly.
location /data/ {
add_header Cache-Control "public, max-age=31536000";
}
location /js/ {
add_header Cache-Control "public, max-age=31536000";
}
location /styles/ {
add_header Cache-Control "public, max-age=31536000";
}
location /favicon.ico {
add_header Cache-Control "public, max-age=31536000";
}
location ~ \.(svgz)$ {
add_header Content-Encoding "gzip";
add_header Vary "Accept-Encoding";
add_header Cache-Control "public, max-age=31536000";
}
I actually noticed that when I posted. I disabled Security altogether for Admin and set it to Essentially Off sitewide. Thanks.Security High in admin might cause you some problems with saving templates.
It's also possible this can become a problem with regular posting if people are posting what looks like code.
You don't think it's important to turn off caching and performance, etc. to Admin?I'd disable that rule personally. For security to Admin area, check out Cloudflare Access (free if you need 5 or less people able to get into it).
Correct. Either you misread my question or I'm confused. (I'm guessing the latter).Nope... everything that needs to be not cached, XenForo already does it automatically.
XF config or nginx config?For Nginx, I use this in the config (which in turn passed through by Cloudflare and causes things to be cached at the edge for a year without needing to use up any of your Cloudflare page rules):
That's Nginx config... For me, that's part of the vhost file for the site withinXF config or nginx config?
/etc/nginx/vhost.d/sitename.conf
.With which rules ?The main one I'd add is www.domain.com/data/*
I have witnessed a delay in the avatar changingif a user changes their avatar what happens?
We use essential cookies to make this site work, and optional cookies to enhance your experience.