• Resolved ingohaeck

    (@ingohaeck)


    Hi Saumya,

    your Plugin works fine for me! Thanks for this.
    I have question concerning AJAX request. The products on my page are loaded with AJAX on an WP Archive page.
    So I had to add a bypass page rule for cloudflare not to cache this page, as it stops AJAX-loading when I use cache.
    Is assets caching ( images ) bypassed too or does cloudflare serve them?
    If assets caching is bypassed too, how can I ensure the assets are cached and delivered thru cloudflare network?
    Thank you

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

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

    (@isaumya)

    Hi,
    first of all, it seems like you are mixing the other approaches that you have used before this plugin, with this plugin. Please note that before using this plugin, inside your Cloudflare dashboard > page rule section, make sure there are no page rules related to modifying cache behavior, time, or things like that. If you have page rules for redirection or something that’s fine.

    Then after you install this plugin it will auto-add 1 page rules (that’s all it needs) and then set the rest of things up on its own.

    Now coming to Ajax, the plugin doesn’t cache ajax requests and always makes sure that ajax requests are bypassed from the cache. This is the default behavior. You don’t have to add any page rule or stuffs like that for it to work: https://i.imgur.com/lZRiImE.jpeg

    So, based on what you said, it should work right out of the box.

    Now coming to the static file. First, make sure that you do not have any expire rule already added in your .htaccess or server rule for static files. Then enable the browser cache for the static file option inside the plugin. If you are in a .htaccess based server it will automatically add the best cache control rule for your static file. If you are in an Nginx server, it will show you the rule and then you need to add them.
    Screenshot: https://i.imgur.com/paX4AAk.jpeg

    P.S.: If you have an eCommerce like site where normal users gets to login and do things, it’s recommended that you use the Worker Mode (screenshot: https://i.imgur.com/2nDxv9S.jpeg) rather than the default page rule mode — which works really well for blog/portfolio like sites where the user won’t login to do anything like that.

    • This reply was modified 2 years, 7 months ago by iSaumya.
    Thread Starter ingohaeck

    (@ingohaeck)

    Thx for your support.
    Everything word fine with now

    Plugin Contributor iSaumya

    (@isaumya)

    Thanks. I am resolving this thread. If you loved the plugin, please do consider sharing a review in the review section of the plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to cache assets but not HTML on pages with AJAX’ is closed to new replies.