• Hi everyone

    I have a question about WordPress / browser caching and dynamic content.

    I have a WordPress site with a custom section where the user can enter his address and get the availability of our services. The result is stored in cookies and then some pages will show different things based on this result.

    The problem is the following :
    Let’s say the user open the Page A and sees the initial content.
    After that, he goes to Page B and uses the section to get availability for his address.
    Now he returns to the Page A. That page should be a bit different now, cause his address is qualified. But what he sees is the initial content. He has to reload the page to see the changes.

    In other words, it looks like that the first time a user visits a page, that page is saved somewhere and never reloaded until the session ends, but I need it to be reloaded every time in case the user has validated his address. How can I achieve that?

    I don’t have any caching plugin and the WP_CACHE is turned off.
    I also notice that if I’m logged in as an administrator, everything works. That’s like the cache is disabled when I’m logged in, but I can’t find a way to disable it for every standard user.

    Thanks in advance

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Yeah, that’s the browser doing the caching if the returned to page is unchanged. It works OK when logged in because WP sends a nocache header when logged in, otherwise editing would be very frustrating.

    You can alter the headers sent to all users through the “send_headers” filter, but that would be a poor idea as it would severely diminish your site’s page speed performance. It would be better if the cookie based content were limited to a page or two that can be nocached, allowing the rest of the site to still be cached. For example, ecommerce sites nocache cart and checkout pages, but all the product pages are cached.

Viewing 1 replies (of 1 total)

The topic ‘Browser cache and dynamic content’ is closed to new replies.