Answered: Is it possible to serve a cached or static version of the site to not logged in users?

Post date: 2021-05-16 01:38:55
Views: 93

Yes, it is possible if your site is hosted on a server using litespeed(or LSCache). Enable LSCache and then configure the Htaccess file as below.

<IfModule LiteSpeed>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^HEAD|GET$
RewriteCond %{REQUEST_URI} !admin|question|login|user|ask|categories|feed NC]
#If there is no login
RewriteCond %{HTTP_COOKIE} !qa_session
RewriteCond %{ORG_REQ_URI} !^/$
RewriteRule .* - E=Cache-Control:max-age=86400]
</IfModule>

Please click Here to read the full story.
 
Other Top and Latest Questions:
3 Body Problem: Countdown
Trying to recall British TV drama from 2000s about teen model
Delicious in Dungeon: Living Armor
TurboTax for contractor and non-contractor work in the USA
Container gardening with Japanese beetles
Movie: Knox Goes Away
I need a database app that will let me do this specific thing
FEUD: Hats, Gloves and Effete Homosexuals
Frieren: Beyond Journey's End: Frieren The Slayer
When did my mono symptoms start? When might they end?