• Hello everyone!

    The following issue: the page is cached (with a common cache for all users), I’ve got some user specific elements on this page, for example some text, that is generated dynamically by php function and rendered with a [shortcode]. So, this content is also cached now and looks the same for all users. All I want is to load this content for each user independently. So, I need a “lazy-load” for this elements. It seems like AJAX is the best approach, but how to use it properly in this case?

    Thanks in advance

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You could exclude this one page from the caching scheme. Most caching plugins have such a provision. It could be more performative to get a complete un-cached page than to update a cached page via Ajax. If the user specific content is all below the fold, it may not matter much either way.

    To implement an Ajax solution, it’s no different than any other Ajax request in WP. You can provide an empty HTML container in the cached page. Inject the desired content into this container via an Ajax request.
    https://developer.www.ads-software.com/plugins/javascript/ajax/

Viewing 1 replies (of 1 total)
  • The topic ‘Load user specific content on a cached page (AJAX?)’ is closed to new replies.