• Resolved Law

    (@laucoste)


    Hi,

    I need to exclude parts of my homepage from cache.

    On my homepage, the elements to exclude from cache are :
    1- A dynamic menu : Variable if the user is logged in or logged out
    2- A dynamic content placed thanks to a shortcode

    1> For the menu, how to exclude it from the cache ? To manage login status, I use the plugin “User Menus”. May I use the “ESI Nonces” for that ?

    2> For the dynamic content with the shortcode, I know about the ‘esi’ to include in a shortcode (https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:esi:shortcode), but how to manage it for my use case ?

    Thank you for your help,
    Regards,
    Law

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support qtwrk

    (@qtwrk)

    Hi,

    1) you can try to use “cache login user” , that will make 2 caches , 1 for guest user, 1 for login user

    2) what do you mean how to manage it ? ESI shortcode didn’t work ?

    Best regards,

    Thread Starter Law

    (@laucoste)

    Hi,

    1/ Thank you
    2/ Oh I should have misunderstood how it works. So on a cached page, put [esi shortcode …] will not cache the content of ‘shortcode’ ? If it is that, that’s perfect.

    Regards,
    Law

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    Yes, on a cached page

    for example you have a block [something] , page cached and this code won’t be changing

    and then if you make it , [esi something ttl="0"] , then this block will no be cached while parent page can still be cached.

    and , in other case, [esi something ttl="3600"] , then this block will be cached for one hour

    and so on.

    but currently , ESI shortcode only works with single shortcode, some plugin uses short code like this [some]xxx[/some] , in this case, ESI won’t work properly

    Best regards,

    Thread Starter Law

    (@laucoste)

    perfect, many thanks !

    Thread Starter Law

    (@laucoste)

    Hi,

    So I’ve tried :
    – Activate ESI button
    – Put my shortcode with ttl="604800"

    But it made my website incredibly slow, and timeouts in the Admin.

    When I removed the shortcode, the site remained very slow. It’s been solved when disabling ESI.

    Would you see some incompatibilities of ESI with Cloudflare that I use, or with something else ?

    Thank you,
    Regards,
    Law

    Plugin Support qtwrk

    (@qtwrk)

    Hi,

    ESI won’t effect in wp-admin URL

    when you enable ESI, please check in HTML source code , search for keyword “<!– Block generated by LiteSpeed Cache”

    each ESI request is ONE sub-PHP-request which could be costly , make sure you don’t put too many ESI block

    Best regards,

    Thread Starter Law

    (@laucoste)

    thank you

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Exclude Dynamic Menu and Shortcode Content’ is closed to new replies.