• Resolved Ben

    (@benrecords)


    Hi @vmarko,

    I’ve got a page which includes a dynamic part to display my availabilities.

    I’ve tried to configure W3 Total Cache to exclude the REST URL but it doesn’t seem to work.

    I’ve then implemented Page Fragment Caching. When I do a hard page refresh things are OK as the JSON file generated from the URL is clearly downloaded from server. Also the rest of the page is correctly cached.

    But when I do a simple refresh or when I access my page with an internal link, it doesn’t download the file from server but from browser cache instead. Indeed, the response header indicates a expiring date set at T+ 1 year (as this is my default configuration for Browser cache TTL).

    How can I do to exclude my specific REST URL from W3 Total Cache ?

    Thanks in advance for your help

    Ben

    The page I need help with: [log in to see the link]

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

    (@vmarko)

    Hello @benrecords

    Thank you for reaching out and I am happy to assist you with this.
    When it comes to Page Caching, any URL within the HTML is also cached. So when the HTML is cached all the contents are cached as well.
    You mentioned that your expiring date set at T+ 1 year. Can you please share if this is for HTML&XML or for static files?
    Can you also please share which part of the page you shared should be excluded from the cache with page Fragment Caching?

    Thanks!

    Thread Starter Ben

    (@benrecords)

    Hello @vmarko ,

    Thanks for your help.

    The URL called within the page is https://www.bluminance.fr/wp-json/wappointment/v1/availability

    In the meantime I found a workaround with Cloudflare. I override the response header forcing Cache-control to no-cache and it works. The URL is now always got from server.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @benrecords

    Thank you for your feedback.
    The W3TC does not have the ability to add or disable headers to specific files/URL’s
    I can see that the headers are:
    cache-control: no-cache, must-revalidate, max-age=0
    I am glad to know that the Cloudflare override works.
    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unable to exclude REST URL from caching’ is closed to new replies.