Caching Static HTML and Ignore Query Strings


#1

Hi everyone,

I want to cache the HTML on this page for any query string:
site.com/page/

For example, I want the following URLs:
site.com/page/?id1=a&id2=x
site.com/page/?id1=b&id2=y
site.com/page/?id1=c&id2=z

So i want to just cache by ignoring the query string.

But here it says support.cloudflare.com/hc/en-us/articles/200168256 :

Ignore Query String / Simple: Delivers the same resource to everyone independent of the query string (Note: The Ignore Query String setting only applies to static file extensions. This setting will remove the query string when generating the cache key, so that a request for “style.css?something” will be normalised to just “style.css” when serving from the cache.).

But it only works for static file extensions listed here:


Cloudflare’s CDN caches the following types of static content by extension for all account types by default: css bmp tif ttf docx woff2 js pict tiff eot xlsx jpg csv eps woff xls jpeg …

How do I ignore query string AND cache HTML???

Thank you,
Evan Jerkunica


Ignore Query String for HTML pages
Ignore Query String for HTML pages
#2

Hi everyone,

I want to cache the HTML on this page for any query string:

For example, I want the following URLs:



For any id value I want to show the base URL content:

So i want to just cache by ignoring the query string.

But here it says https://support.cloudflare.com/hc/en-us/articles/200168256 :
Ignore Query String / Simple: Delivers the same resource to everyone independent of the query string (Note: The Ignore Query String setting only applies to static file extensions. This setting will remove the query string when generating the cache key, so that a request for “style.css?something” will be normalised to just “style.css” when serving from the cache.).

But it only works for static file extensions listed here:

How do I ignore query string AND cache HTML???

Thank you,
Evan Jerkunica


#3

This is possible using custom cache keys. At the moment that is an enterprise only feature. it might also be possible using Cloudflare workers.


#4

Hi everyone,

I want to cache the HTML on this page for any query string:

For example, I want the following URLs:



For any id value I want to show the base URL content:

So i want to just cache by ignoring the query string.

But here it says https://support.cloudflare.com/hc/en-us/articles/200168256 :
Ignore Query String / Simple: Delivers the same resource to everyone independent of the query string (Note: The Ignore Query String setting only applies to static file extensions. This setting will remove the query string when generating the cache key, so that a request for “style.css?something” will be normalised to just “style.css” when serving from the cache.).

But it only works for static file extensions listed here:

How do I ignore query string AND cache HTML???

Thank you,
Evan Jerkunica


#5

Please do not double post:


#6

Can you please delete this one then? The other one has the correct urls.


#7

i am sure @sdayman will merge :wink:


#8

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