litespeedtech / lscache-drupal

LSCache Plugin for Drupal
GNU General Public License v3.0
14 stars 15 forks source link

Works only on the homepage #20

Open jcmartinez opened 4 years ago

jcmartinez commented 4 years ago

I can see the headers X-LiteSpeed-Cache: hit or X-LiteSpeed-Cache: miss only in the homepage. I cannot see these headers in other pages of the site.

How to reproduce I added this module to an existing site, enabled the module and enabled the Debug option.

Expected behavior I would expect to see a hit or a miss on every page.

Things I've tried

  1. I have looked at the pages as an anonymous user.
  2. I've also tried using Chrome Incognito Mode.
  3. I have uninstalled the core Drupal Internal Page Cache module suspecting a conflict while leaving installed the Dynamic cache module.

Thank you for your work on this module.

yoyo-rk commented 1 year ago

If your Drupal site is setting a session cookie on non-homepage pages, then it's likely causing Drupal to set the cache-control headers with must revalidate, private, no cache etc. Usually a session cookie will be set on pages that have search or input fields, login fields, or other features that require tracking a session data. We experienced this on our site and had to make some adjustments to our pages. LSCache will basically tell LSWS to cache any page that Drupal would normally set cache control headers on to public, max-age=XXXX. So you have to do the work in Drupal to get LSCache to act as desired.