Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal - Make $rocket_remove_query_strings part of config file and add a filter #1597

Closed
arunbasillal opened this issue Mar 29, 2019 · 3 comments
Assignees
Labels
module: cache type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Milestone

Comments

@arunbasillal
Copy link
Contributor

There are many use cases where users want the same cache file to be served for multiple values of query strings. And we do have a whitelist that is hard-coded into process.php (WP Rocket 3.2.6) -

/**
* Don't cache with query strings parameters but the cache is served if the visitor comes from an RSS feed, a Facebook action or Google Adsense tracking
*
* @since 2.3 Add query strings which can be cached via the options page.
* @since 2.1 Add compatibility with WordPress Landing Pages (permalink_name and lp-variation-id)
* @since 2.1 Add compabitiliy with qTranslate and translation plugin with query string "lang"
*/
$rocket_remove_query_strings = [
'utm_source' => 1,
'utm_medium' => 1,
'utm_campaign' => 1,
'utm_expid' => 1,
'fb_action_ids' => 1,
'fb_action_types' => 1,
'fb_source' => 1,
'fbclid' => 1,
'gclid' => 1,
'age-verified' => 1,
'ao_noptimize' => 1,
'usqp' => 1,
'cn-reloaded' => 1,
'_ga' => 1,
];

If we could make this whitelist part of the config file and have a filter (to be used during the config file generation) to add custom values to this, a lot of customers would find it useful.

@Tabrisrp Tabrisrp added type: enhancement Improvements that slightly enhance existing functionality and are fast to implement module: cache labels Mar 29, 2019
@Tabrisrp Tabrisrp added this to the 3.4 milestone Apr 25, 2019
@webtrainingwheels
Copy link

webtrainingwheels commented Jun 3, 2019

There is also a need from customers to be able to change the default behaviour of our currently whitelisted parameters.

Not every customer wants the same cache file to be served for every variation of a parameter. They may want the URL cached but a separate cache file per value (as if they had manually entered the parameter into the Advanced Rules setting). So we should provide a way to be able to remove entries from the default whitelist as well as add custom values.

We have a few tickets where this behaviour causes issues for tracking, e.g.
https://secure.helpscout.net/conversation/864381130/109554?folderId=377611
https://secure.helpscout.net/conversation/845778320/106726/
https://secure.helpscout.net/conversation/877338650/111281?folderId=273761

Essentially, we should allow customers to choose how they want query strings to behave on their site. So we can set our opinionated handling as defaults but everything should be made filterable for the user.

@camilamadronero-zz
Copy link

@Tabrisrp Tabrisrp self-assigned this Jul 16, 2019
@sabrina-zeidan
Copy link

sabrina-zeidan commented Jul 23, 2019

Another ticket and another one

@Tabrisrp Tabrisrp assigned Tabrisrp and unassigned Tabrisrp Jul 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: cache type: enhancement Improvements that slightly enhance existing functionality and are fast to implement
Projects
None yet
Development

No branches or pull requests

5 participants