How to: Serve different cache based on cookies etc.
-
Hi Donncha,
i want to display a welcome box for first time visitors. This box is only generated if a specified cookie doesn’t exist. To work smoothly with wp supercache i wrote a supercache-plugin.
As far as i understood one has only to change the cache_key so another file is generated for this cache ( wp-cache-md5($cache_key).html ). My method looks like:
function wp_add_first_time_visit_cachekey($key) { if(!isset($_COOKIE['visited'])) { $key .= 'firsttime'; } return $key; } add_cacheaction( 'wp_cache_key', 'wp_add_first_time_visit_cachekey' );
Everything worked fine on my previous installation. But i just changed my theme and therefore also updated WP to 3.1.2. (i know, never change a running system -.-). I also deleted some plugins and added new ones. Domain mapper is now installed ( thanks ?? ).
Ok i think the problem is, that there are mostly supercache/sitename/path-to-post/index.html files generated instead of wp-cache-md5 ones. It’s my guess that it has something to do with the domain-mapping plugin. How can i fix this issue? I just want to serve different caches based on a cookie value.
I am using Wp-Supercache 0.9.9.9. Mode is set to PHP and my htaccess is cleaned.
Btw. Thanks for the great work you did with the wp-supercache plugin!
-Alex
- The topic ‘How to: Serve different cache based on cookies etc.’ is closed to new replies.