Cloudflare Cache Problem?

Hello, I want to know that for days, I think I remember wrong, I thought that this was a problem and my files were not cached. As far as I know, when a file is served from Cloudflare cdn, when source controlled the url is:

[Preformatted text](https://cdn.cloudflare.com/style.css) (example only)

It should show like this, but even though I’m using pro, it still looks like this:

[Preformatted text](http://mywebsite.com/wp-content/themes/mytheme/assets/css/style.css)

I guess everything is fine like this? So yes, files like style, js, image seem to be on my server as url, but they are published from Cloudflare cdn servers?

So even if the urls are still visible on my server, EXAMPLE someone entering from France is accessing my files from Cloudflare servers there?

Can I sleep peacefully tonight?

The assets like CSS files will still show your URL, but there will be a new header of CF-Cache-Status which shows if your file was severed from Cloudflare’s cache or your origin server.

Where can I check the CF-Cache-Status header? I want all my files to stream from Cloudflare server, what should be the value for that?

From the docs I linked

To investigate cache responses returned by the CF-Cache-Status header, use services like Redbot, webpagetest.org, or a visual tool like Chrome’s Dr. Flare plugin.

If it was served from Cloudflare, then you will see HIT.

When i check the network

my domain is: cf-cache-status: BYPASS
style.css is : cf-cache-status: EXPIRED
js files are: cf-cache-status: EXPIRED
images files are: cf-cache-status: BYPASS

HOW CAN İ CHANGE ALL THEM “HIT”?

From the docs I linked

EXPIRED The resource was found in Cloudflare’s cache but was expired and served from the origin web server.
The item was in Cloudflare’s cache, but the cache time expired and was then served from your origin. You can increase the cache time from your origin server

BYPASS The origin server instructed Cloudflare to bypass cache via a Cache-Control header set to no-cache,private, or max-age=0 even though Cloudflare originally preferred to cache the asset. BYPASS is returned when enabling Origin Cache-Control. Cloudflare also sets BYPASS when your origin web server sends cookies in the response header.

1 Like

İts ok Dude. I understood perfectly. thank you so much. But how can i change this settings to HIT in my Cloudflare panel? i check the url they are just information.

You can’t “set it in the Cloudflare panel”, you need to make sure the origin server sends appropriate headers.

You could override them with rules, but it seems the wrong way around, unless you can’t change the origin in any way.

So should I make these settings on my vps server? Please excuse my amateur nature. Thank you very much for your kindness.

Ideally yes, it’d be the best way to fix cache headers. If you were to ever remove the domain from behind Cloudflare, or pause the proxying, it would continue caching content as expected on users’ devices.

I know it’s a broad topic. Can you explain in a few sentences how I can fix this on my Linux/Whm/Cpanel server? Maybe I can figure it out if you at least tell me what to look for in search engines to fix this?

Yeah, can’t help you there… setups are so varied, that even attempting that will be a nightmare.

I’d search for cache-control headers with your stack info. It should be pretty trivial. Do get to know what each keyword does, as they are pretty important.

Everythings are ok i did… but only my images are still BYPASS… is there any Cloudflare panel configuration for HIT to my images?

As I said above…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.