Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
litespeed_wiki:cache:lscwp:esi_block [2020/04/03 12:59]
Lisa Clarke Copy editing
litespeed_wiki:cache:lscwp:esi_block [2020/04/03 21:01]
qtwrk
Line 11: Line 11:
 some_code_here some_code_here
 <div> <div>
-apply_filters( '​litespeed_esi_url',​ '​my_esi_block',​ '​Custom ESI block' );+<?php 
 +echo apply_filters( '​litespeed_esi_url',​ '​my_esi_block',​ '​Custom ESI block' ); 
 +?>
 </​div>​ </​div>​
 some_code_here some_code_here
Line 21: Line 23:
 add_action( '​litespeed_esi_load-my_esi_block',​ '​my_esi_block_esi_load'​ ); add_action( '​litespeed_esi_load-my_esi_block',​ '​my_esi_block_esi_load'​ );
  
-function ​my_esi_block_esi()+function ​my_esi_block_esi_load()
 { {
 do_action( '​litespeed_control_set_ttl',​ 300 ); do_action( '​litespeed_control_set_ttl',​ 300 );
-echo "Hello world";​+#do_action( '​litespeed_control_set_nocache'​ ); 
 +echo "Hello world".rand (1,99999);
 } }
 </​code>​ </​code>​
Line 30: Line 33:
 In this example, ''​my_esi_block''​ is the block name, ''​Custom ESI block''​ is a short comment, and ''​300''​ is the TTL for this block. In this example, ''​my_esi_block''​ is the block name, ''​Custom ESI block''​ is a short comment, and ''​300''​ is the TTL for this block.
  
-You can change it to ''​do_action( '​litespeed_control_set_nocache'​ );'' ​or change ''​300''​ to ''​0''​ , if you want to set this block to ''​no-cache''​.+You can change it to ''​do_action( '​litespeed_control_set_nocache'​ );''​ if you want to set this block to ''​no-cache''​.
  • Admin
  • Last modified: 2020/04/03 21:01
  • by qtwrk