• Resolved tdechangy

    (@tdechangy)


    I use a posts grid plugin that opens posts as modal popup, then I can also navigate prev/next posts while staying in modal view. The problem is that it takes 1,5s or even more to load the ajax requests each time (to wp-includes if I’m correct), and this is quite terrifying as UX.

    So is it possible and how can I cache those far to heavy requests ?

    NB : this answer was NOT what I am looking for : https://www.ads-software.com/support/topic/cache-admin-ajax-request/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter tdechangy

    (@tdechangy)

    While looking for a solution I saw this for the Swift Performance plugin which has this kind of much needed feature @ https://swiftperformance.io/blog/how-to-cache-ajax-get-requests-with-swift-performance-pro/ It’s a bit additional work in their case, but for sure, this should dramatically enhance any dynamic website’s performance (eventually including ecommerce ones if some configurations might stick wisely).

    However, while looking to the website (https://www.mathieuweemaels.be), I I didn’t see any clear admin-ajax.php call, instead this plugin uses a xhr” container where lays an ajax call..

    Maybe can you also have an overlook on the site’s homepage and open a popup from the art pieces grid.

    Regards.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tdechangy

    Thank you for your inquiry and I am happy to assist you with this.
    Caching the ajax calls is not recommended as they are being used in most cases to actually bypass cache and serve the dynamic content on a cached page. For example Woocommerce cart etc.
    Let me check on this and investigate more and I’ll get back to you.
    Thanks!

    Thread Starter tdechangy

    (@tdechangy)

    – Sure, Ajax has its own reason to avoid caching, but in fact many plugins/functionalities use ajax in excess, which causes dramatic increase in load time while not needed at all.

    Meanwhile this case seems to be a good example, here iw the last answer from the plugin author :

    About your caching sggestion: https://www.shift8web.ca/2018/11/how-to-cache-queries-to-admin-ajax-php-in-wordpress-to-improve-performance/
    I already use a custom AJAX call and the post object retrieval is already cached by wordpress (and other cache plugins).
    there’s really nothing left to improve on that side.

    Since I don’t have php/JS developer skills, it’s hard for me to understand how to go further here.

    – You said : “Let me check on this and investigate more and I’ll get back to you.” What timeframe do you estimate for this ? A couple hours, days, or more ?

    Definitely, a selective Ajax caching is something much needed.
    + By the way I found the plugin “WP admin cache” which is an awesome addition for admin side (maybe could this feature be implemented in W3TC..).

    Regards.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tdechangy

    Thank you for the information.
    I need to check with the team and devs if this solution can be implemented and if it’s needed since this is the first request of this kind. I’ll get back to you as soon as I have the answer.
    Thanks!

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tdechangy

    Thank you for your patience. I spoke with the developers about this and I can confirm that ajax calls are hard-blocked, meaning they are not being cached due to the nature of the ajax call usage.
    We do not have plans to add this feature in the future, however, I can open a Github issue on your behalf (or you can do it yourself) and see if we get more requests for it. Again, this is the first request of this kind.
    Thanks!

    Thread Starter tdechangy

    (@tdechangy)

    All right, I opened a ticket @ https://github.com/W3EDGE/w3-total-cache/issues/299. Can you please check its content and put it as request ?

    Hoping to read you in coming month to include this feature.

    Thanks.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @tdechangy

    All done. Please make sure to track the progress of the issue regularly.
    Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘How to cache Ajax requests’ is closed to new replies.