How long Cloudflare keeps cached files?


#1

I was trying to understand how often Cloudflare gets rid of the cached HTML files in their nodes.
I was reading some information about it here and here but I don’t have it yet very clear.

They say that Cloudflare will respect your origin expires / cache control headers to calculate the Edge Cache TTL.

But how do I specify on my server the expires / cache control headers ?
Is it this on Apache’s htaccess file?

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 hour"
ExpiresByType image/jpeg "access 1 hour"
ExpiresByType image/gif "access 1 hour"
ExpiresByType image/png "access 1 hour"
ExpiresByType text/css "access 1 hour"
ExpiresByType text/html "access 1 hour"
ExpiresByType application/pdf "access 1 week"
ExpiresByType text/x-javascript "access 1 hour"
ExpiresByType application/x-shockwave-flash "access 1 week"
ExpiresByType image/x-icon "access 1 hour"
ExpiresDefault "access 1 week"
</IfModule>

Should I use a bigger value if I do not expect those values to change in the short term?
Something like 8 days? So my clients won’t have to request data to my server for 8 days and instead get it from Cloudflare’s cache?

But… will Cloudflare respect those 8 days of Cache and keep a copy of those pages in their nodes for 8 days? (Sounds like a lot of space for them for their millions of sites.


#2

Bump? Any answer?


#3

Let me see what I can find about this.