• Resolved wlsfh

    (@wlsfh)


    Hi guys,

    I have read few posts as well as the guidelines as published at: https://github.com/W3EDGE/w3-total-cache/wiki/FAQ:-Developers#how-does-page-fragment-cache-work

    But it seems I cannot make this work.

    On my front page I use a geo tagged map, which refreshed upon used accept to share their location.

    I would like to cache it all but the shortcodes I use for MAP and SEARCH RESULTS.

    I followed your instructions:
    1. Set DISK:basic in Page Cache
    2. Set mfunc and mfclude in Minify – comments
    3. Set rule define(‘W3TC_DYNAMIC_SECURITY’, ‘FRAGMENT_CACHING’); in wp-config
    4. Set rule
    <!–mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> –>
    echo do_shortcode(‘[gmw map=”2″]’);
    echo do_shortcode(‘[gmw search_results=”2″]’);
    <!–/mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> –>

    5. Set ‘late initialization’

    So far it seems the rules is not effective and my geo tagged results and maps are cached.

    Any idea?
    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wlsfh

    Thanks for reaching out.
    The configuration is not set up properly. Everything is explained in the article you provided.
    Please follow the instructions carefully
    <!–mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> –> is not a valid mfunc comment
    Thanks!

    Thread Starter wlsfh

    (@wlsfh)

    Hi Marko,

    Thanks for the prompt reply.

    I fixed the code to:

    <!–mfunc FRAGMENT_CACHING –>
    echo do_shortcode(‘[gmw map=”2″]’);
    echo do_shortcode(‘[gmw search_results=”2″]’);
    <!–/mfunc FRAGMENT_CACHING –>

    But still does not work.

    Was wondering if Cloudflare extension got something to do with it, or not?
    Thanks

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @wlsfh

    Thank you for the information.
    I’ve tested the Conde and it works as expected. Cloudflare should not have anything to do with this as this is related to Page Cache.
    YOu should reach out to some developer for assistance with this as once again this needs to be set up properly and we are not offering these types of services.
    Some important guides are that the comment/code blocks should be added to your theme template files as HTML and not within the PHP open (<?php) and close (?>) tags, as it will cause a PHP parse error/syntax error. Do not include any sensitive information in your code fragments; the code can be revealed if W3 Total Cache is deactivated, the Page Cache is changed to use an incompatible storage engine, or the defined W3TC_DYNAMIC_SECURITY string value is changed or not defined.
    Caching and Geotagging are not bet friends. The best thing to do is to either don’t cache the page or, and this is the best practice, use ajax to load the maps dynamically to bypass the cache.
    Thanks!

    Thread Starter wlsfh

    (@wlsfh)

    Hi Marko,

    Thanks for your hints. We went through the code, followed the guide as per your recommendation but still did not manage to achieve Page Fragmentation, hence preventing a specific dynamic content from being cached.
    We are looking into Ajax Maps as you recommended, which could be the right solution, but in the meanwhile I wanted to ask if it’s possible to tell W3TC to exclude some specific cookies from being cached.

    Geo My WP stored user’s location in a specific cookie and we would like to give it a try.

    Thanks

    • This reply was modified 3 years, 7 months ago by wlsfh.
    • This reply was modified 3 years, 7 months ago by wlsfh.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Page fragmentation and shortcodes’ is closed to new replies.