Clear dynamically content cache when displaying the Menu?

Home Forums Pro Support Clear dynamically content cache when displaying the Menu?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #68164
    Iokin PardoIokin Pardo
    Participant

    Hi,

    I would like to clear some cache of the Container content that at this moment it seems to be cached.

    I have a piece of code inside the “Additional Content” section with HTML code and several shortcodes.
    Everything seems to be running fine. But once the first user displays the Menu, this code is cached so the second user will see previous user information as it seems to be cached.

    Is there any way to clear this cache everytime the Menu is displayed? This will avoid displaying other users information.

    Thank you very much.

    #68171
    Peter FeatherstonePeter Featherstone
    Participant

    Hi there,

    I’m afraid that’s not really a question for my plugin but rather for the caching plugins you are using.

    My plugin doesn’t do any HTML caching itself so there is nothing to clear from my side.

    Please advise

    Peter

    #68170
    Iokin PardoIokin Pardo
    Participant

    Hi Peter, yes you are completly correct. The cache is due to the W3Total Cache plugin that is enabled.
    Now, I would like to know where I should need to add the “Fragment Caching” piece of code in order to avoid caching the Complete Responsive Menu or part of it.

    <!–mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> –>
    echo ‘The time is ‘.date( ‘H:i:s’, time() );
    <!–/mfunc <?php echo W3TC_DYNAMIC_SECURITY; ?> –>

    Thank you very much in advance.

    #68169
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Iokin,

    Sorry I don’t understand what you mean by Fragment Caching, what is that?

    My plugin is automatically injected into your page so there is nowhere to wrap it in those comments you have above which is what I assume you are trying to do?

    You could go down the route of using the shortcode instead and then explicitly including it in your templates at which point you could wrap it in those comments.

    That sounds like the only way to achieve that.

    Peter

    #68168
    Iokin PardoIokin Pardo
    Participant

    Thanks Peter.

    Let’s try in a different way, mayybe the question I have done is not the proper one, sorry.
    What PHP files are the ones that are called in order to inject the Menu HTML piece on the pages?
    Maybe if I exclude them from the caching procedures the Menu content will not be displayed from the cached elements and the Menu will be built every time is called.

    Thank you very much in advance.

    #68167
    Peter FeatherstonePeter Featherstone
    Participant

    Hi Iokin,

    There is no PHP file that injects the Menu HTML on the page and if there were you should never edit those directly.

    I don’t think what you are asking is possible with W3 Total Cache. I don’t even know how it could half cache a page and ignore other parts. That sounds more inefficient than efficient.

    Have you spoken to W3 Total Cache themselves about the possibility of not caching the output of particular plugins?

    Please advise

    Peter

    #68166
    Iokin PardoIokin Pardo
    Participant

    Yes, fragment caching is possible caching half a page (static content) and ignore other parts (dynamic content).

    Fragment caching to the rescue:
    https://www.justinsilver.com/technology/wordpress/w3-total-cache-fragment-caching-wordpress/

    In my case, the Menu have static elements like navigation buttons, and a dynamic content inside the “Additional Content” section built with HTML and shortcodes.

    Those shortcodes seems to be cached too and this is an issue for our case. So I would like to know exactly where to attack to exclude the caching.
    For us is not a problem excluding the complete Menu from the cache.

    Thanks.

    #68165
    Peter FeatherstonePeter Featherstone
    Participant

    Hey Iokin,

    So as per my previous reply you will need to use the shortcode, use PHP to echo this in your templates and then wrap that in the mfunc comments.

    I don’t know if that will stop the shortcode in Additional Content from caching as that is a separate thing not controlled by my plugin.

    All the best

    Peter

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Clear dynamically content cache when displaying the Menu?’ is closed to new replies.