• Resolved Nate1

    (@nate1)


    Hello,

    Is it possible to vary cache by the Cloudflare country value i.e. HTTP_CF_IPCOUNTRY
    Is there a hook or similar that could be used to append the value and allow for variation for the customers.

    I’d like to use this to display prices including and including taxes.
    That would mean simply two variations of the cache in this instance.
    I’d also expect its only needed against the page cache as is just a small change for how the html is rendered. The dynamic functions load the prices correctly once a shipping address is added.

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Nate1

    (@nate1)

    Found the solution,

    Set Page Cache = Basic

    Then modify, did look to vary a little when printing the values. Some including gzip but others not. A good definition of how this should be used would be good, but does appear to be working currently.

    dd_filter('w3tc_page_extract_key', 'theme_w3tc_page_extract_key', 40, 8);
    function theme_w3tc_page_extract_key($_page_key,
    	$useragent,
    	$referrer,
    	$encryption,
    	$compression,
    	$content_type,
    	$uri,
    	$page_key_extension){
    
    	return $_page_key . $country_code;
    }
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @nate1

    Thank you for your inquiry and your suggestions.
    I need to check and get back to you on this once I can confirm if this can be done.
    Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @nate1

    Thank you for your patience.
    As you can see here:
    https://github.com/W3EDGE/w3-total-cache/blob/feature-showcase/PgCache_ContentGrabber.php#L334-L343
    It has a condition if ( $with_filter ) {
    I hope this helps!
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Modify Cache Key’ is closed to new replies.