Support » Plugin: WP Super Cache » Configure WP Super Cache to Forward Url Parameters to Existing Cached Page

  • optimized-marketing


    I am using WP Super Cache in mod_rewrite mode. I see there is an option to either ignore Get Parameter (ex. ?parm=test) or have them cached as their own page.

    I have a bunch of pages that use GET parameters for JavaScript purposes. Things from Google Analytics Tracking Parameters to Google Content Experiment Parameters to Parameters which are used to show a different Phone Number based on the value. They are all Javascript based so they should not be part of the original caching of the page.

    Is there a way to pass the parameter to an existing cached file?

    For example:
    There is a cached page for
    Someone goes to
    It loads the originally cached page for and includes the ?name=bob to the page when it loads?
    So the page still loads the original cached file but the parameters can be used to display the page and forwarded to 3rd party systems that are JS based.

    I am not totally sure but I believe there might be a way to do this with mod_rewrite in the .htaccess file but I am not sure if there are any plug-in specifics that need to be set or configured. Or which part of the htaccess mod_rewrite code that wp super cache provides needs to be reworked.

    This will help decrease the number of cached pages on the server and help with the handling of GET Parameters in WP Super Cache.


Viewing 5 replies - 1 through 5 (of 5 total)
  • optimized-marketing


    I noticed this topic has been brought up a few times and the only real solutions I see are from this two thread:

    They update the plug-in to achieve what I am asking about, but it is for an older version of the plugin. Is there a reason this hasnt been added to the plugin?

    I also on

    The author of the said an parameter ignore list would be helpful, but didn’t promise anything. Is there any update on this feature? Is it in the works still?

    If these two features could be combined, so you could make a list of GET parameters that are ignored during the Super Caching process but are included in the final url of the page. That would be the perfect compromise. Since the parameters (ones added to the ignore list) used by JS will load the supercached page but the parameters that are used by PHP will continue to act as it currently does(regular cache).



    Donncha has this been added to your future features list?

    Plugin Author Donncha O Caoimh


    I’m afraid it’s not high on my list of things to do, sorry.

    I am using the code from this post:

    Problem is that by using it I loose all Google Adwords tracking.

    I could disable caching for pages with GET, but many pages make use of GET, so most traffic would not be cached.

    Donnacha, couldn’t you come up with a way to pass the gclid parameter to a cached pages.

    At first, it could be something as simple as duplicating on the fly an already cached page and appending the glcid parameter. I don’t know it that can be accomplished with rewrites in htaccess.

    I hate having to choose caching over tracking or vice versa.

    I managed to forward pages with gclid parameter to a page ending with just “?” by adding this code to wp-cache-phase1.php:

    $wp_cache_request_uri = $_SERVER[ 'REQUEST_URI' ]; // Cache this in case any plugin modifies it.
    $wp_cache_request_uri = preg_replace('/gclid=[\w]+&?/i', '', $wp_cache_request_uri);
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Configure WP Super Cache to Forward Url Parameters to Existing Cached Page’ is closed to new replies.