CACHE

#1
I am using Lite-speed server. I have over 3k community pages that displays real estate listings. When the page runs we have various complex queries that we run on our API and return those values back into transients. We have about 10,000 transients. If I pre-cache the community pages the main page runs very fast. However when we start paging to see more listings the page slows which I am not sure why because the transients have all the data on the page. When I page ie. abc.com/p2 I am not seeing those pages being cached so the main cached page must be reused for the paging. The big question is why are the corresponding pages slow ?

Also I have tired to use mem and Redis cache for the transients but I am not seeing any speed performance increase.
 

serpent_driver

Well-Known Member
#2
The big question is why are the corresponding pages slow ?
Your page will not be fast because of the transients, but only because of the HTTP cache. If you have many pages with pagination and they are slow, then the reason is quite simple to explain. These urls are not in the sitemap and if these urls are not in the sitemap then the cache for these urls will not be warmed up.
 

serpent_driver

Well-Known Member
#4
Forget the transient. For loading speed almost only the cache matters. Transients are nice, but there much more and other components they slow down the page speed. Transients don't help either. Everything is only about the cache (LScache engine != transient)
 
#5
How are people using Fragmented cache ? The Transients is an absolute must for freeing up the API and allowing complex data to be loaded quickly. The first page load is loading in ms while subsequent pages are loading in around 1.2 seconds. Lite-speed Cache is stored in a db correct ? Its not stored in the directory cache like W3 Cache ? Also do you see people pre warming sites of thousands of pages ?
 

serpent_driver

Well-Known Member
#6
LiteSpeed has a better solution for fragmented cache. It is called Edge Side Includes or just ESI, but I think you don't know the differencies between HTTP Cache and transients. These are completely different things.

LiteSPeed LScache is a server based HTTP cache and works completely different as every other cache plugin. It doesn't store the cache in database. If a page is cached the LScache engine creates compressed text files in /lscache directory for each URL and if a URL is requested only the text file is sent to the client. If a page is cached there is no more PHP and MySQL and this makes the loading so fast. Transients or any other object cache is not used if a page is cached and can't be used because a plain text file doesn't allow to run any scripts. LScache is also URL based. That means each URL gets its own cache copy, so whenever a URL is changed e.a. by a GET Parameter this is a new URL and gets a new cache copy.

This all means if you want to have fast loading use the built-in crawler to warmup the cache.
 
#7
What is the exact path way to the lscache directory. I am not seeing it on my digital ocean Lite-speed server. I do see entries in the DB but not in the directory under content.
 

serpent_driver

Well-Known Member
#8
It depends on kind of hosting and LScache configuration. Normally /lscache directory is in home directory of your account, but some hosting provider sets /lscache directory outside, so you can't access it. It also possible to store cache files in SHM. If you want to access the cache files you won't be able to see anything readable in these files, because they are compressed. And again, LScache has nothing to with database. The cache plugin doesn't cache anything. It's just a control panel to control how the cache should work and only these config data are stored in the database.
 
#9
So if I go to say page abc.com and its pre cached and then I hit abc.com/p1 . If the abc.com/p1 is not cached will it become cached after I hit the page. Thee reason I ask is that after I hit the page 2 or 3 or 4 or 5 and then visit those pages on another computer the abc page loads fast and the others load 1.2 to 1.9 seconds. Its seems like those pages do not cache.
 
#10
I am running the Lite-speed cache server on Digital Ocean so I was trying to find the directories of cached pages. I just wanted to see if those page files are being created.
 

AndreyPopov

Well-Known Member
#12
I am running the Lite-speed cache server on Digital Ocean so I was trying to find the directories of cached pages. I just wanted to see if those page files are being created.
my hoster store lscache at /home/.system/lscache/<account_name>

but I must ask hoster to store lscache in my account because by default hoster store lscache in default system folder

(I solve this problem with hoster during two weeks :( and hoster add this option to host GUI Control Panel )


So if I go to say page abc.com and its pre cached and then I hit abc.com/p1 . If the abc.com/p1 is not cached will it become cached after I hit the page. Thee reason I ask is that after I hit the page 2 or 3 or 4 or 5 and then visit those pages on another computer the abc page loads fast and the others load 1.2 to 1.9 seconds. Its seems like those pages do not cache.
yes, each page must be precached and even it use pagination or infinitive scroll these are also must be precached.
and for different UA (desktop, mobile, etc) must be exist own version of cache
 
Last edited:

serpent_driver

Well-Known Member
#13
So if I go to say page abc.com and its pre cached and then I hit abc.com/p1 . If the abc.com/p1 is not cached will it become cached after I hit the page.
Yes.

Thee reason I ask is that after I hit the page 2 or 3 or 4 or 5 and then visit those pages on another computer the abc page loads fast and the others load 1.2 to 1.9 seconds. Its seems like those pages do not cache.
If you are logged in and if you have caching for logged in users enabled, then the cache is private. That means that every logged in user has an own (private) cache copy.
 
Last edited:

serpent_driver

Well-Known Member
#14
I am running the Lite-speed cache server on Digital Ocean so I was trying to find the directories of cached pages. I just wanted to see if those page files are being created.
The only safe way to verify if a URL is cached is to check server response header: x-litespeed-cache: hit or miss.
 

AndreyPopov

Well-Known Member
#17
https://docs.litespeedtech.com/lscache/

A page cache's job is to take this dynamically generated web page, and store it as a static HTML snapshot.


How does LSCache Work?
Imagine you have an uncached page.

A visitor requests that page, and a few things happen:

  • LiteSpeed looks for the page among its stored cache objects and does not find it
  • LiteSpeed returns a "cache miss"
  • The web app dynamically generates a static HTML page while the visitor waits
  • LiteSpeed serves the static HTML page to the visitor
  • LiteSpeed stores the static HTML page as a cache object for later use
A few minutes later, another visitor requests that same page. Here's what happens:

  • LiteSpeed looks for the page among its stored cache objects and finds it
  • LiteSpeed returns a "cache hit"
  • LiteSpeed immediately serves the static HTML page to the visitor
 
#18
IS there a way for the crawler to a take a sitemap url abc.com and tell it to index the paging ? I cant list the paging because I have no idea how many pages and it changes constantly. My cache can only be fresh for 3 hours tops.
 

serpent_driver

Well-Known Member
#19
How does LSCache Work?
An HTML page is a text file that only becomes an HTML page because of the file extension and is rendered as such by the browser. Therefore, the content-type of an HTML page is "text/html". If the documentation speaks of an HTML page, then this is for the simplified functioning of the cache. This doesn't change the fact that a cached page is a text file. THe one who writes the documentation doesn't know everything. Also static sources can be cached by LiteSpeed and static sources are not HTML. Check my website and verify it.
 
Last edited:
Top