Overview
Add AJAX functionality to Bricks Builder conditions so they work even with server or page caching is used. The feature will refresh or update specific individual block/s with conditions on page load or DOM load so conditioned blocks don’t show outdated or incorrect results especially for geo-based conditions. This will put Bricks Builder ahead of the game in solving cache related condition issues.
Details
- AJAX Conditions
-
Add “Enable AJAX Update” option for conditions.
-
When enabled, the condition will:
-
Make an AJAX request to refresh or update the condition before showing content to the user.
-
Dynamically check the user’s state, e.g. location or session, and return updated values.
Example Use Case:
- Geo-conditions fetch and show location-specific content without being affected by caching.
- Caching Issues Solved
-
Conditions won’t get “stuck” or outdated due to server or page cache.
-
Up-to-date content will be displayed for conditions that rely on dynamic data.
- How to Implement (idea or suggestion, possible better methods)
-
Use AJAX, localStorage and cookies for managing and syncing conditions:
-
localStorage: Stores user-specific data (e.g. user type, preferences) on the client side for fast access.
-
Cookies: Makes user-specific data available to PHP for server-side processing.
-
AJAX Sync: Synchronizes client and server in real-time, so conditions are up-to-date.
-
Use existing AJAX handling methods, same as in Bricks Builder pop-up.
Benefits
-
More Accurate: Dynamic and real-time condition updates, no more caching errors.
-
Better User Experience: Show content relevant to the user’s context.
-
Unique Selling Point: Bricks Builder will be the first page builder to solve cache related condition issues.