Cf-cache-status: DYNAMIC after setting Page Rule Cache Everything

The issue is related to the URL -

In Page Rules, I have set -

Cache Level: Cache Everything, Origin Cache Control: On

The PHP Headers are set as -

	function ( $headers ) {
		if ( (! is_user_logged_in()) ) {
			$headers['Cache-Control'] = 'public, max-age=2592000';
			$headers['Expires']       = gmdate( 'D, d M Y H:i:s', time() + 2592000 );
		} else {
			$headers['Cache-Control'] = 'private, no-cache';
		return $headers;

Even after this, the response headers I am getting are:

date: Fri, 20 Aug 2021 12:50:31 GMT
content-type: text/html; charset=UTF-8
cache-control: public, max-age=2592000
expires: Sun, 19 Sep 2021 12:50:30
vary: Accept-Encoding
cf-cache-status: DYNAMIC
nel: {“success_fraction”:0,“report_to”:“cf-nel”,“max_age”:604800}
server: cloudflare
cf-ray: 681bbf679ee2d6b5-FRA
content-encoding: br
alt-svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400, h3=":443"; ma=86400
:status: 200

What changes I have to make to get cf-cache-status: HIT?

Thanks in advance.
Note: I have removed the links from the response header pasted here due to the restrictions in number of links.

You put a dot at the beginning. That means only subdomains get that Page Rule. Make it *wpcwv instead and it’ll work.

1 Like

You’re matching all subdomains but NOT the apex domain. Change this to **

Thanks @sdayman and @WalshyMVP
So silly of me.
:man_facepalming: :man_facepalming: :man_facepalming:
I am ashamed to show my face.


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