Custom Slug cache page refresh all time
-
I am using the Whatsapp user agent to create a selected cache page. But whenever you access the page it updates the cache. Every time I update the page a new cache is created with a new date. See my code that is in the mu-plugins:
if ( function_exists( "add_filter" ) ) { add_filter( 'supercache_filename_str', 'supercache_custom_ua_keys' ); } else { add_cacheaction( 'supercache_filename_str', 'supercache_custom_ua_keys' ); } function supercache_custom_ua_keys($key) { if(strpos(strtolower($_SERVER['HTTP_USER_AGENT']), 'whatsapp') !== false ){ $key .= '-whatsapp'; } return $key; }
The topic ‘Custom Slug cache page refresh all time’ is closed to new replies.