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:troubleshooting:php_session_and_cache [2020/05/04 13:51]
Shivam Saluja
litespeed_wiki:cache:lscwp:troubleshooting:php_session_and_cache [2020/11/14 15:43] (current)
Lisa Clarke Redirect to new Documentation Site
Line 1: Line 1:
-====== Caching Pages That Depend on PHP Session ====== +~~REDIRECT>​https://​docs.litespeedtech.com/​lscache/​lscwp/​troubleshoot/~~
-**Please Note**: This wiki is valid for v2.9.x and below of the LiteSpeed Cache Plugin for WordPress. If you are using v3.0 or above, please see [[https://​docs.litespeedtech.com/​lscache/​lscwp/​overview/|the new documentation]]. +
- +
-If you have pages that depend on the PHP Session, you will find that they don't work properly with LiteSpeed Cache. +
- +
-===== Symptom and Behavior ===== +
- +
-Some plugins such as WHMpress that use PHP session to store values (currency, language...etc) don't work with LiteSpeed Cache. +
- +
-Once LiteSpeed Cache is enabled, user dependant values like currency do not work or display correctly. +
- +
-===== Cause ===== +
- +
-Pages whose content depends on PHP session are not cache-friendly. Once the cached page is generated, it will //not// vary on session data. +
- +
-Why? LiteSpeed Cache is designed to avoid hitting the PHP backend. Therefore, there is no way for the cache module to know what value is stored in PHP session for any visitor other than the first one to load the page. +
- +
-===== Solution: ===== +
- +
-To make this to work, a code change to the third party plugin is required. The developer can change the plugin to store the value in a cookie and then LiteSpeed Cache can be set to [[litespeed_wiki:​cache:​developer_guide:​cache-vary|vary on that cookie]]. +
- +
- +
  • Admin
  • Last modified: 2020/05/04 13:51
  • by Shivam Saluja