• I have Recent posts in the sidebar of my post pages using a simple WP_Query but I’ve noticed that it doens’t update on older pages so people viewing older posts don’t see newer stories via the sidebar.

    I have page cache, minify, and browser cache, and CDN enabled. What exactly can I tune to have that sidebar expire on a frequent basis or not cache at all so it’s up to date?

    https://www.ads-software.com/plugins/w3-total-cache/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Anonymous User 8639124

    (@anonymized-8639124)

    Curious about something similar myself, though I’m pretty sure the answer (to my question at least) is that I can’t do what I want to do with caching enabled.

    I have two subsections of responsive code in header.php — one that loads for mobile browsers and the other for desktops/tablets. I assume the reason those aren’t working as intended for logged-out users is that it caches and reuses whatever version the very first visitor loads…if the first visitor is on a mobile device, the mobile version of the code is cached and then presented to everyone thereafter, no matter what device.

    So would I be right in saying there’s no way (as bcwint00 and I hope to) to disable caching of a section or the loaded contents of a template file?

    Anonymous User 8639124

    (@anonymized-8639124)

    k, for my issue, it’s mostly resolved:
    https://www.ads-software.com/support/topic/caching-plugins-and-responsive-design-code-in-template-files

    bcwint00, someone should correct me if I’m wrong, but as I understand caching, it saves a static version of an otherwise dynamically generated page. Before you say, “Well, d’uh,” I myself hadn’t taken the next mental step ’till yesterday to realize that means you can’t carve out a section to say “but don’t cache this“. It’s all or nothing.

    That said, for your Recent Posts question, it may not be a big deal. Again I might be misunderstanding the way things work, but I believe the default in W3TC is for things to be cached for only three minutes. (Check out this page on your site: /wp-admin/admin.php?page=w3tc_objectcache.) Visitor #1 comes to your page at time = 0; that version of the page is cached. Visitor #2 comes to your page at time = 60 seconds; that visitor is served the cached page. Visitor #3 comes to your page at time = 181 seconds; that visitor gets the page served brand new. So unless you have a ton of traffic and are constantly publishing new posts, it seems like it shouldn’t be an issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable cache for portion of web page?’ is closed to new replies.