Files minification and cache status


#1

Hello,
i’m sorry but i didn’t undestood so well what the cache status means.

I’m trying to undestand how it works.

I read here: https://support.cloudflare.com/hc/en-us/articles/200168266-What-do-the-various-Cloudflare-cache-responses-HIT-Expired-etc-mean- but it’s not so clear for me.

I mean, if i’ve got a js file with that headers:

Request URL: http://www.xxxx.yyyy.it/template/js/www.main.js
Request Method: GET
Status Code: 200 OK (from disk cache)
Remote Address: 104.27.177.120:80
Referrer Policy: no-referrer-when-downgrade
Cache-Control: public, max-age=14400
Cf-Bgj: minify
CF-Cache-Status: EXPIRED
Cf-Polished: origSize=13738
CF-RAY: 4268b980946e4328-MXP
Content-Encoding: gzip
Content-Type: application/javascript
Date: Wed, 06 Jun 2018 06:11:58 GMT
ETag: W/"35aa-56d463db99163-gzip"
Expires: Wed, 06 Jun 2018 10:11:58 GMT
Last-Modified: Mon, 28 May 2018 16:02:14 GMT
Server: cloudflare
Vary: Accept-Encoding

And another js file with:

Request URL: http://www.xxxx.yyyy.it/admin/js/wwww.js
Request Method: GET
Status Code: 304 Not Modified
Remote Address: 104.27.176.120:80
Referrer Policy: no-referrer-when-downgrade
Cache-Control: public, max-age=14400
CF-Cache-Status: EXPIRED
CF-RAY: 4268ba65c63d3d83-MXP
Connection: keep-alive
Date: Wed, 06 Jun 2018 06:12:34 GMT
ETag: "1c9f-56de7aedd8015-gzip"
Expires: Wed, 06 Jun 2018 10:12:34 GMT
Last-Modified: Tue, 05 Jun 2018 16:38:42 GMT
Server: cloudflare
Vary: Accept-Encoding

First off all, the first one is minified but not the second one, can you explaine me the reasons?

Other thing, when the cache status is EXPIRED, the file is served from my original server? When he will cached again from CloudFlare ?

Thanks a lot.


#2

I’m not familiar with the Cf-Bgj header. Most references to it are in regard to Polish image compression. But if you look at the downloaded file itself, is only one of them minified?

Expired means it has to go back to your origin server and get it again. How all the cache settings all work together is a bit of a mystery to me.


#3

Thank for reply.
About the minification i think there is something inside the file who block this action, so ok for that.

About Expired files ok, the cache is expired and the file is served from the original server but… if i refresh the page i expect to see the cached file (Cache-status = HIT) but it’s still expired. That’s what i’m not understand.


#4

It’s staying EXPIRED? That doesn’t sound good. If the CF-Cache-Status is always EXPIRED, you should open a Support Ticket and send them the URL.

Again, how all cache settings work together is a bit of a mystery, but I suppose it’s possible your server is setting browser cache expiration time that’s very low. Maybe @MarkMeyer or @Matteo know.


#5

Mmm I’m not completely sure why that is staying as Expired, would be great to see the actual URL.

Is it possible that there are some page rules interfering? Or that the the Cache-Control header sent by your origin includes a no-transform?


#6

The second request was a conditional request from the client and a 304 response was returned (the file was not downloaded again) because the file hadn’t been modified. You could look at the actual file in your cache to see if it was minified the first time it was downloaded (I suspect it was) but the headers in the 304 don’t need to reflect that since no action was taken to give you the file.


#7

This topic was automatically closed after 14 days. New replies are no longer allowed.