Support » Plugin: WP Super Cache » [Plugin: WP Super Cache] Using supercache with a theme switching cookie

  • Resolved Jonathan Stegall



    I have a site (running 3.1) that needs to display a different header and footer (for a partner who promotes the site) if a specific querystring is present. For simplicity, is how this works. I am just getting familiar with how the system works, as I didn’t create it and I’m trying to discover what it’s issues are.

    The main theme, then, does the following things:

    1. Check for a cookie, or a $_GET value.
    2. If either matches, set the cookie (if it is unset), add the needed HTML, and run an add_filter (change_template) to switch the theme itself to one that contains the right HTML.

    This works well, though I’m not sure how efficient it is. The problem is that I don’t think Super Cache ever caches pages that have the querystring. It does run on those pages, as I see the following in the footer everytime:

    <!-- Dynamic page generated in 0.413 seconds. -->
    <!-- Cached page generated by WP-Super-Cache on 2011-03-16 09:28:56 -->

    So I think it just doesn’t cache anything. Anyone have insights into this? Alternatively, a better method for switching themes and storing the result based simply on a querystring?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Bump? Still lost on this one.

    Plugin Author Donncha O Caoimh


    The first page with the GET query won’t be cached, but you can modify the COOKIE checks in wp-cache-phase1.php to look out for your partner cookie. You can use a cacheaction instead of modifying source code. (see the developer docs linked from the readme) Pages will however be cached using legacy caching mode in the current version.

    The next version will have code to create new supercache directories but it’s incomplete right now.

    In case others should have this issue, for the time being (though I’ll look forward to the next version of course) I’ve decided to use the DB Cache Reloaded plugin (with a fix for WP 3.1). It just caches database queries, so the page gets rendered in whatever theme is appropriate for the user, whether based on querystring, cookie, or some other method.

    Now, of course this is a really random situation that I’ve never had on any other sites, so I can certainly understand that it’s not the highest of priorities 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: WP Super Cache] Using supercache with a theme switching cookie’ is closed to new replies.