How to cache page2, page3, etc?

Lee

Well-Known Member
#1
So, how can I get lscache to cache beyond just the first page of products?

I have categories that are 5 pages deep when set to 100 per page or 11 pages when set to 48 per page.

This is actually VERY important for the client especially on a mobile device, they don't like waiting for 7-12 seconds for a page to load.
 

Lee

Well-Known Member
#2
OK, I found my own anser:

You must add product/catalog to litespeed "page settings" in order for them to be cached. Why is this not on by default?
 

AndreyPopov

Well-Known Member
#3
So, how can I get lscache to cache beyond just the first page of products?

I have categories that are 5 pages deep when set to 100 per page or 11 pages when set to 48 per page.

This is actually VERY important for the client especially on a mobile device, they don't like waiting for 7-12 seconds for a page to load.

some answers here

developer only implement my idea for pages for categories in changes from 04 June 2021
you must install latest version.


You must add product/catalog to litespeed "page settings" in order for them to be cached. Why is this not on by default?
product/catalog and product/manufacturer/info not cached by default.
 

Lee

Well-Known Member
#4
You keep saying I must install the latest version and again I respond "I HAVE"!!!

I had a crash course in PHP programing the past two days and me, a nobody, has made significant improvements to the code that the programmers should have already implemented. This litespeed for opencart is in the dark ages in my opinion because I should not have to be rewriting code with no experience to fix the shortcomings...

1) I now have pages 1 thru 20 cached.
2) I removed cached categories that the frontend will never request. This saved 30% in time and disk space.
3) I fixed where it didn't clear out the array before going on to the next procedure, hence it did the same ones twice.
4) It now caches the filtered manufactures for each category. Now when they click a manufacture in the filters it's cached and fast. I've only figured out how to cache just one checked item at a time so if they click multiple manufactures to filter it goes back to being slow. But this was a MAJOR improvement.
 

Lee

Well-Known Member
#6
$urls[] = $this->url->link('product/category', 'path=' . $categoryPath[$category['category_id']] . '&fm=' . $result['manufacturer_id']);
 

AndreyPopov

Well-Known Member
#7
$urls[] = $this->url->link('product/category', 'path=' . $categoryPath[$category['category_id']] . '&fm=' . $result['manufacturer_id']);
cache only first page of result :(
and what you to do when user want make sort by price?

and the main: this is your private example, like for me, all products in category already have same manufacturer.

users of my site not need in this filter.
and include in main algorithm not needed!!!

to cache specific paths of your site you can add they in GUI at "URL Settings" tab in "Include URLs" field
 

Lee

Well-Known Member
#8
cache only first page of result :(
and what you to do when user want make sort by price?

and the main: this is your private example, like for me, all products in category already have same manufacturer.

users of my site not need in this filter.
and include in main algorithm not needed!!!

to cache specific paths of your site you can add they in GUI at "URL Settings" tab in "Include URLs" field
Yes, it only caches the first page and the first option clicked but as I said earlier it's still a big improvement for the customers experience. Perfect? No but I just learned to program a little PHP two days ago. I am not a programmer, I never saw PHP or twig in my life until now. Any suggestions on how to make it better?

I do not have a sort by price, my site is custom with 90% of all my products are setup as options hence no price sorting.

Yes, it's MY PRIVATE example, it works for me and there's going to be others that it will work for that's why I posted it, sorry it won't work for you.
 
Last edited:

AndreyPopov

Well-Known Member
#9
I do not have a sort by price
like I wrote above - I not need filter by manufacturer in category
some sites only from one manufacturer, for example.

these all depends from kind of products.


You're a programmer
no. I advanced user :)


Any suggestions on how to make it better?
all my ideas in corresponding threads.
but I try make universal solutions for all users.
even I add specific features for Journal theme, I add code to except this feature when not Journal.

developers only add basic functions for middle-statistics sites.

in "advanced crawler" thread I in few next days attach code.
 
Last edited:
Top