• Hi Team,

    Thank you for this awesome work.

    I use the plugin Jet Smart Filters which allows me to filter and paginate a product grid. I see this plugin has the option to cache Ajax Requests but I would only like to cache these specific ones.

    Is there a setting or a filter/action in the code that I can use to filter certain Ajax and skip the rest?

    BTW. This is a POST ajax. I am not sure if that is relevant but I’m mentioning just in case.

    Thank you very much in advance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    First of all ajax requests should never be cached. If you cache if you uncheck this option: https://i.imgur.com/32gDzT3.png it will just make sure we don’t bypass cache for the ajax URL and let CF cache it.

    All ajax requests uses the same endpoint URL i.e. /admin-ajax.php so you either cache it or don’t.

    Thread Starter jesus225

    (@jesus225)

    Thanks for your quick response.

    For testing purposes, I have configured the plugin this way: https://i.imgur.com/5Q2Xjrm.jpg

    However, ajax is still not cached. These are the response headers sent for the pagination ajax call: https://i.imgur.com/BjXoTJJ.jpg

    Is there any other setting I should enable?

    Thanks.
    Regards.

    Plugin Contributor iSaumya

    (@isaumya)

    However, ajax is still not cached. These are the response headers sent for the pagination ajax call: https://i.imgur.com/BjXoTJJ.jpg

    Are you checking as a loggedin user? If so check as a non loggedin user.

    Thread Starter jesus225

    (@jesus225)

    Hello,

    I was checking with Incognito mode, as anonymous user.

    You can check yourself going to the site URL you can see in the image, click on “Tienda” at the top and scroll all the way down to see the AJAX pagination buttons.

    Domain is not going through CF since I am testing fallback page cache now.

    Thank you.
    Regards.

    Plugin Contributor iSaumya

    (@isaumya)

    I saw that the ajax requests are POSTS requests that the plugin is making. POST requests are never cached by Cloudflare. Only GET & HEAD requests are supposed to be cached. POST, PUT, DELETE, UPDATE etc. requests are never supposed to be cached by any system whatsoever.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Cache Ajax Requests’ is closed to new replies.