Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision Next revision Both sides next revision | ||
litespeed_wiki:cache:lscwp:esi_block [2020/04/02 20:58] qtwrk created |
litespeed_wiki:cache:lscwp:esi_block [2020/04/02 21:02] qtwrk [How to make my code into ESI block] |
||
---|---|---|---|
Line 24: | Line 24: | ||
function my_esi_block_esi() | function my_esi_block_esi() | ||
{ | { | ||
+ | do_action( 'litespeed_control_set_ttl', 300 ); | ||
echo "Hello world"; | echo "Hello world"; | ||
} | } | ||
</code> | </code> | ||
- | where **my_esi_block** is the block name , for your convenience , **Custom ESI block** is short comment | + | where **my_esi_block** is the block name , for your convenience , **Custom ESI block** is short comment , **300** is the TTL for this block. |
+ | |||
+ | change it to ''do_action( 'litespeed_control_set_nocache' );'' or change **300** to **0** , if you want to set this block to **no-cache**. |