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:api [2019/03/27 19:55]
Lisa Clarke [Nonce Issues]
litespeed_wiki:cache:lscwp:api [2019/03/27 20:09] (current)
Lisa Clarke [Functions]
Line 179: Line 179:
  
 === LiteSpeed_Cache_API::​nonce($string) === === LiteSpeed_Cache_API::​nonce($string) ===
-This creates an ESI block for WordPress'​ own "​create nonce" function, assigns it a TTL of 12 hours, and then calls ''​wp_create_nonce($string)''​. Essentially,​ you can cache the nonce function independently of the page it is on. This allows you to serve fully-cached pages even when they include a nonce. Replaces ''​wp_create_nonce($string)''​ in your code. +**Deprecated** ​This creates an ESI block for WordPress'​ own "​create nonce" function, assigns it a TTL of 12 hours, and then calls ''​wp_create_nonce($string)''​. Essentially,​ you can cache the nonce function independently of the page it is on. This allows you to serve fully-cached pages even when they include a nonce. Replaces ''​wp_create_nonce($string)''​ in your code. 
  
 +=== LiteSpeed_Cache_API::​nonce_action($string) ===
 +Call this function before creating a custom nonce so that the new nonce will be treated as an ESI block with a TTL of 12 hours. ''​$string''​ should be the same as the parameter that you pass to ''​wp_create_nonce''​.
 + 
 === LiteSpeed_Cache_API::​vary($vary_name,​ $vary_value,​ $default_value) === === LiteSpeed_Cache_API::​vary($vary_name,​ $vary_value,​ $default_value) ===
 Use this function to create a cache vary. Cache varies allow you to store multiple public versions of the same page in cache. So, if your application was for multiple currencies, you would use this function and pass it the name you have given the vary (i.e. ''​myapp_currency''​),​ the currency the current visitor is using (i.e. ''​EUR''​),​ and the default currency (i.e. ''​USD''​). [[litespeed_wiki:​cache:​developer_guide:​cache-vary | Learn more about cache varies.]] Use this function to create a cache vary. Cache varies allow you to store multiple public versions of the same page in cache. So, if your application was for multiple currencies, you would use this function and pass it the name you have given the vary (i.e. ''​myapp_currency''​),​ the currency the current visitor is using (i.e. ''​EUR''​),​ and the default currency (i.e. ''​USD''​). [[litespeed_wiki:​cache:​developer_guide:​cache-vary | Learn more about cache varies.]]
  • Admin
  • Last modified: 2019/03/27 20:09
  • by Lisa Clarke