Home › Forums › WoodMart support forum › Guest wishlist button states with Cloudflare full-page caching

Guest wishlist button states with Cloudflare full-page caching

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #731859

    Moatasem Gamal
    Participant

    Hello WoodMart team,

    Could you improve the native guest wishlist buttons’ compatibility with full-page caching?

    My configuration:

    – Cloudflare caches public shop, category and product pages.
    – Logged-in customers bypass caching.
    – The personal wishlist page is excluded from caching.
    – WordPress AJAX requests remain uncached.

    The concern is the saved/unsaved state of wishlist icons in product cards.

    From reviewing WoodMart 8.6.4:

    – PHP can render buttons with an added class based on the current visitor’s wishlist.
    – The guest JavaScript reads woodmart_wishlist_products and marks matching products as saved.
    – However, it does not clear stale added classes or reset labels for products absent from that guest’s cookie.

    Consequently, if shared cached HTML contains checked buttons, another guest can receive incorrect states.

    Could WoodMart handle this natively by:

    1. Rendering neutral, unchecked wishlist buttons in guest HTML.
    2. Synchronizing **both saved and unsaved states**, including labels, from the guest’s cookie.
    3. Repeating synchronization after AJAX-loaded products, product tabs, filtering, pagination and Back/Forward navigation.

    This should allow guest product pages to remain cached without requiring a separate AJAX request for every product.

    A companion implementation using this approach passed our previous local shared-HTML tests. Actual Cloudflare edge validation has not yet been performed.

    Could you include equivalent support in WoodMart, or advise whether an existing native setting provides it?

    Thank you.

Viewing 1 post (of 1 total)