How to ignore specific query parameter with varnish cache?

Posted 1 year ago by keevitaja
/swatches/ajax/media/?product_id=17620&isAjax=true&_=1524469655019

I need to cache this request with varnish, but i need to ignore the last query parameter _=1524469655019.

I am not sure how varnish internally works, but i suppose it makes the cache uid key from the url requested. So in my case it would need it only to create the uid key from this url

/swatches/ajax/media/?product_id=17620&isAjax=true

Doing something like req.url ~ "^/swatches/(.*)$" would not work as varnish would still use the entire url for cache uid.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.