Title: Exclude Dynamic Menu and Shortcode Content
Last modified: August 24, 2020

---

# Exclude Dynamic Menu and Shortcode Content

 *  Resolved [Law](https://wordpress.org/support/users/laucoste/)
 * (@laucoste)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/exclude-dynamic-menu-and-shortcode-content/)
 * 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](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](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/exclude-dynamic-menu-and-shortcode-content/#post-13304858)
 * 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](https://wordpress.org/support/users/laucoste/)
 * (@laucoste)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/exclude-dynamic-menu-and-shortcode-content/#post-13305403)
 * 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](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/exclude-dynamic-menu-and-shortcode-content/#post-13305442)
 * 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](https://wordpress.org/support/users/laucoste/)
 * (@laucoste)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/exclude-dynamic-menu-and-shortcode-content/#post-13305574)
 * perfect, many thanks !
 *  Thread Starter [Law](https://wordpress.org/support/users/laucoste/)
 * (@laucoste)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/exclude-dynamic-menu-and-shortcode-content/#post-13311922)
 * 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](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/exclude-dynamic-menu-and-shortcode-content/#post-13313674)
 * 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](https://wordpress.org/support/users/laucoste/)
 * (@laucoste)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/exclude-dynamic-menu-and-shortcode-content/#post-13321982)
 * thank you

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Exclude Dynamic Menu and Shortcode Content’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

## Tags

 * [menu](https://wordpress.org/support/topic-tag/menu/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 7 replies
 * 2 participants
 * Last reply from: [Law](https://wordpress.org/support/users/laucoste/)
 * Last activity: [5 years, 9 months ago](https://wordpress.org/support/topic/exclude-dynamic-menu-and-shortcode-content/#post-13321982)
 * Status: resolved