This article is for Elementor developers and also for the Crocoblock team, who I believe could be more responsive in considering my request.
[UPDATE] May 1, 2024 : I am testing AJAX Container here : https://sandbox.okparfait.dev/
[UPDATE] April 29, 2024 : CTO of Crocoblock has opened a GitHub repository here : https://github.com/MjHead/jet-ajax-container
Hello, I’m Anthony, a webmaster focused on making my clients’ websites faster.
After much thought, I’ve come to a conclusion about an important feature that should be in Elementor.
So, let me explain why it would be interesting to add the « AJAX Container » feature to Elementor and what it could bring to website creators.
My observations
Lots of website owners use tools like WP Rocket or Lightspeed Cache to speed up their websites. But sometimes, it’s not a good idea to cache certain pages. For example, pages where users log in or register should remain cached to avoid problems.
Use Case N°1 : Better Performance on WooCommerce Pages (login, cart, checkout)
Imagine a website built with WooCommerce and cached with WP Rocket. All pages are cached except some : like the registration page, login, cart page, and the checkout page.
The downside here is having to exclude the entire page from caching.
In this scenario, AJAX Containers could asynchronously load only a specific area where the « Login » block is located, allowing us to cache the page.
Use Case N°2: Avoid Constant Cache Clearing
A client asked me to automatically display the number of registered users on a page of his site, without manually updating it.
To do this, I used QueryBuilder of JetEngine to retrieve this user count.
After that, I displayed this number with a text block. Everything was good, but there was a problem with caching the page. It stopped the number of registered users from updating, even when new people signed up.
I had two choices:
- turn off caching for this page
- clear the cache regularly
But neither option was really practical or effective.
AJAX Containers could « encapsulate » the section displaying the number of registered users, allowing this small part of the page to be dynamically updated without affecting the rest of the cached content. This approach retains the benefits of caching while ensuring that the count of registered users is always current..
Here is an example :
Important Note:
So far, I’ve been able to solve this issue using the tabs feature of the Crocoblock JetTabs plugin. With JetTabs, we can load tab content using AJAX, which makes me even more confident that implementing AJAX Containers can solve these issues.
Implementation Suggestion
Here is an example of how an AJAX container could be integrated into Elementor :
Layout Section
Style Section
I hope to see this feature added and I appreciate the teams taking the time to consider my request.