Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 82367

fragment caching works only for logged in users

$
0
0

Replies: 0

Hi,
At one part of my homepage the content changes according to the user geo-location. This is a Google map that shows the user’s current location.
The dynamic parameter for the map is the current country code (‘usa’,’gb’ etc..), retrieved from the user’s IP.
I have set this area for fragment caching, by defining the W3TC_DYNAMIC_SECURITY on my wp-config file and nesting the dynamicly created country code within a mfunc tag:

<!--mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> -->
$country_name = (function_exists('get_country_name') && get_country_name() != '')?get_country_name():'usa';
echo $country_name;
<!--/mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> -->

This works, but only for logged in users.
Any idea where did I go wrong?
Many thanks in advance.


Viewing all articles
Browse latest Browse all 82367

Trending Articles