openlitespeed cache without plugin not work

krrish

New Member
#5
I have this now
x-litespeed-cache: miss
but only on the index.php page or the site's main page, but for an asset like JS, CSS is not shown in the header response.
 

LiteCache

Active Member
#6
I set up all configurations, but still header not using x-LiteSpeed-cache :
There is nothing special to run LScache without a plugin, but a cache plugin makes it easier to handle it.

Just add this to your htaccess.

Code:
<IfModule LiteSpeed>
CacheLookup on
RewriteRule .* - [E=cache-control:max-age=[time in seconds]
</IfModule>
That's it, but you have to define more cache rewrite rules to exclude specific directories from being cached or any other HTTP conditions like cookie or whatever can be defined to exclude these conditions from being cached. You also need a PHP function to delete the cache if necessary. This recommends so called cache tags, which you can freely assign for each individual URL in extreme cases. Then you can either purge the entire cache of a domain or just the cache of certain URLs or a group or whatever. The documentation will help you.
 
Last edited:
#10
I have this now
x-litespeed-cache: miss
but only on the index.php page or the site's main page, but for an asset like JS, CSS is not shown in the header response.
LSCache is a full html page cache.

also, try place LSCache rules before others rewrite rules.
 
Last edited:

LiteCache

Active Member
#11
LSCache is a full html page cache.
This doesn't matter, because nobody asked for to cache only particular content. Especially since this question does not even arise with OLS. It's only about to make cache available without any plugin. Rewrite Engine is always enabled and there is no need to point this out specifically.

Please limit your comments to providing productive advices to those seeking help. Everything else is irrelevant
 
#13
This rule works only on domain / but all CSS/js /images can't get any cache from openlitespeed > is it normal?
<IfModule litespeed>
CacheLookup on
RewriteEngine On
RewriteCond %{REQUEST_URI} !/admin/ [NC]
RewriteRule .* - [E=cache-control:max-age=120]
</IfModule>
 

LiteCache

Active Member
#15
This rule works only on domain / but all CSS/js /images can't get any cache from openlitespeed > is it normal?
CSS, JS, images and so on are static sources and such sources are cached by the browser and cannot cached by OLS. The browser needs such sources to be cached, not the server.
 
#17
This rule works only on domain / but all CSS/js /images can't get any cache from openlitespeed > is it normal?
yes.

LSCache store in cache each page like static html page that already contain needed js/css/images/font depending from your page optimization settings like image and font lazy load, html minify, CSS Combine & Minify , CSS Inline , JS Combine & Minify , JS Defer , etc.

you can make that all js/css/images/font included to html page code but you "must pay" by size of stored LSCache.

for example of my site - https://www.priazha-shop.com/alize-alpaca-royal-02
page stored in lscache:
- with lazy load (image/fonts) + minify (html/CSS/JS) without CSS Inline with default gzip compression occupy arround 50kB (not compressed ~480 kB)
- with CSS Inline with default gzip compression arround 80kB


yes, CSS Inline make cached page more responsible, but I have 10000 pages of products - 30*10000 = 290MB additional storage space only for one UA (desktop), and additional 290MB for mobile view, 290MB for Safari desktop(iMac), 290MB for Safari mobile (iPhone) - total 1 GB :(



that you must decide what cache.
 
Last edited:

LiteCache

Active Member
#18
yes, CSS Inline make cached page more responsible, but I have 10000 pages of products - 30*10000 = 290MB additional storage space only for one UA (desktop), and additional 290MB for mobile view, 290MB for Safari desktop(iMac), 290MB for Safari mobile (iPhone) - total 1 GB
Therefore it is smarter not to use UCSS inline. It is even smarter to use UCSS as Critical CSS, because only CCSS actually improves the loading time. In addition, it consumes significantly less storage space and the storage size of the main document is only slightly larger.
 
Top