Does "Ignore Query String" also Strips the query string?

Hello,

I am trying to understand how the “Caching Level: Ignore Query String” page rule works.

I assumed that what it means is that Cloudflare will ignore the query string, but it also seems that it strips the query string in the cases that Cloudflare doesn’t have a cached version and the request reaches my server. Is this how it is supposed to work?

What I want:

  1. A request is made for http://mydomain.com/x.js?y=10
  2. Cloudflare doesn’t have x.js in its cache yet, so that whole request (including the query string) reaches my server, which provides a response.
  3. Later a request is made for http://mydomain.com/x.js?y=15
  4. Cloudflare already has x.js in its cache, so it ignores the query string and responds to the request without passing the request to my server.

However it seems that at step 2 Cloudflare makes the request to my server without the Query. So it acts more like “strip query”, rather than just “ignore query”?

It should be that step 2 hits your origin with query string because it isn’t cached so passes fully to your origin which logs request with query string the first time. But if your origin logged it without query string, make sure that

  1. you are indeed logging query strings
  2. that indeed this was a non-cached MISS request which it should be as it logged to your origin

Cache Level for Ignore Query String will only trigger for step 3 & 4 of your example :slight_smile:

2 Likes

Hey, thanks for your reply.

I checked both 1 & 2, and the query string is not received by my server. It receives the request but without the query.

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