rtomayko / rack-cache

Real HTTP Caching for Ruby Web Apps
http://rtomayko.github.io/rack-cache/
Other
822 stars 124 forks source link

Add a proc to allow ignoring parts of the query string in the key #161

Closed bencrouse closed 4 years ago

bencrouse commented 4 years ago

A proc for ignoring parts of query strings when generating a key. This is useful when you have parameters like utm or trk that don't affect the content on the page and are unique per-visitor or campaign. Parameters like these will be part of the key and cause a lot of churn.

Thought I'd open this as a PR to see if the maintainers were interested. Lemme know if otherwise, and I'll just monkey patch in my project!

grosser commented 4 years ago

Seems like a semi-common issue, lots of people deal with tracking params.

bencrouse commented 4 years ago

My comments on each below:

Thanks for your time @grosser !

grosser commented 4 years ago

1.11.0