Cache Everything with Ignoring Query Strings for PHP pages

I need to cache a PHP page “https://example.com/my-page.php”. I use page rule for the url “https://example.com/my-page.php*” with Cache Everything and Edge cache TTL. as shown below.


But i need to ignore the query strings aswell. For the domain i have set Cache Level as “Ignore query string” as below

And still i see MISS in the cf-cache-status header when i visit the same url with different query strings.

How do i achieve caching PHP page and same time ignore the query strings? I donot want to redirect users.to the page. Is there a way? Or am I understanding the wrong way?

I think your Cache Everything wildcard is catching query strings.

How about adding a rule above that one to match example.com/my-page.php (without the wildcard) and add a setting to Bypass Cache? Maybe that will trigger first and not cache query strings.

But I need to show the cached version even for the query URLs… I don’t want any request to reach to my origin. I want to show same cached source for every Request to that PHP PAGE even it contains different query parameters. Thats what i am trying to do.

1 Like

So you want all calls to my-page, with or without query string to have the same (cached) response?

I wonder if Origin Cache Control would work in conjunction with that Ignore Query String setting.

yes. Thats what i am looking for.

1 Like

It seems this has come up before with a one suggestion from @cbrandt.

Yeah I know the problems. And even i didn’t want to redirect/rewrite the urls with workers. In the php generated htmlpage there is a script which use getParams() fuction :man_shrugging:t4: to get parameters to display something.

May be this can be a new Product Request. Cache Everything and Ignoring Query String

It’s a feature available on the Enterprise plan.

It’s also possible to do something similar with workers alone on other plans, but purging the cache by cache key is an ENT only feature.

1 Like

Enterprise. Got it.

For now I donot need to purge by cache key :man_shrugging:t4: I can purge using entire URL. I just need to Cache Everything and Ignore Query params just like it works for static content cache level of Ignore Query Params May be its all related.

Is there any updates on this? I get lots of cache MISS for the samepage with different query parameters like “fbclid” and lots other parameters. Rewriting or redirecting urls with parameters isn’t a good option at all.

Consider adding this option. Really requested feature for many.

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

I really need this feature to include on Cloudflare page rules. Today I see many many more requests on page with different query parameters.

Adding this feature would be really helpful. I really don’t want to strip the query parameters. But rather want to show the same cached content for different query parameters as well.