Article threads and data usage increase

Covert

Member
We recently upgraded to 2.2 and set the home page to our announcements, using the article thread type. Since each article has an attachment for the preview, this resulted in a very noticeable data usage increase. We are currently utilizing Cloudflare Argo so each GB counts for the monthly cost.

My first idea is to create an addon that puts attachments for article threads into a separate folder that can be cached by Cloudflare without any security implications. I wanted to get other opinions first before going that route.

4KaBhkkD2k.png

grauBWYETW.png
 

Wildcat Media

Well-known member
That's good to know. We are well within our bandwidth limits on our hosting accounts, but I can definitely see where there could be increased usage. I'll watch this thread...
 

Xon

Well-known member
No, XF sends headers which prevent caching and the cloudflare auto-caching only works based on extension and a lack of explicit caching headers.

I might have an update coming for my (free) attachment improvements add-on which may help
 

Kevin

Well-known member
Would the one by @TickTackk help? I'm not using a CDN so I don't know how it'd react but otherwise it seems to work fine with changing the headers of attachments.

 

TickTackk

Well-known member
Would the one by @TickTackk help? I'm not using a CDN so I don't know how it'd react but otherwise it seems to work fine with changing the headers of attachments.

Cloudflare only caches based on file extension and doesn’t cache by MIME type. The Cloudflare CDN automatically caches files containing certain file extensions and doesn’t cache HTML by default:
From: https://support.cloudflare.com/hc/en-us/articles/200172516-Understanding-Cloudflare-s-CDN
 

Kevin

Well-known member
{Kevin is taking mental notes for the future if he ever uses Cloudfare....}
Looks like a two prong approach would be needed, changing the XF headers like your addon does and creating a CF cache rule.

Resources that match a Cache Everything Page Rule are still not cached if the origin web server sends a Cache-Control header of max-age=0, private, no-cache, or an Expires header with an already expired date. Include the Edge Cache TTL setting within the Cache Everything Page Rule to additionally override the Cache-Control headers from the origin web server.
 
Top