CS-Cart Cache Lifetime?

Where can I set the lifetime/expiration of the cache? I would like to the cache to be valid for 24 hours before expiring.

[quote name=‘solesurvivor’ timestamp=‘1314494831’ post=‘120487’]

Where can I set the lifetime/expiration of the cache? I would like to the cache to be valid for 24 hours before expiring.

[/quote]



Are you sure you really want to do this? ;)



Really defeats the whole purpose of even using a cache at all.



In the later versions of CS-Cart, and especially if the SQLITE method of Cache is chosen, it is essentially “set it & forget it”, the way it should be.

[quote name=‘Struck’ timestamp=‘1314498069’ post=‘120489’]

Are you sure you really want to do this? ;)



Really defeats the whole purpose of even using a cache at all.



In the later versions of CS-Cart, and especially if the SQLITE method of Cache is chosen, it is essentially “set it & forget it”, the way it should be.

[/quote]



Otherwise it seems the cache must expire in a shorter period automatically and if it expires it means the site will load slower for customers. Right now I pre-cache my whole website (not CS-Cart) using a custom php script. We have built a crawler that crawls our website page by page so every page will be pre-cached for customers and there be little to no delay. Cs-Cart is great but much to slow at times and were at risk of loosing customers if that happens to some of those that dont want to wait really. I mean its only 3-5 seconds but its eternity in net time. Customers want it in a split second to pop up. no waiting.

[quote]it seems the cache must expire in a shorter period automatically[/quote]



No, that is not correct!



For starters, you need to go back a step and mention what version of CS-Cart you are actually running and which Cache Method have you selected so that we can better help.


[quote]Cs-Cart is great but much to slow at times and were at risk of loosing customers if that happens to some of those that dont want to wait really. I mean its only 3-5 seconds but its eternity in net time.[/quote]



You are absolutely right in that 3-5 seconds page load time is eternity, however, I can assure you there are many Cs-Cart users including myself with page load times in the 1 to 1-1/2 second range (or faster)! ;)



Here is an example of one bloody fast CS-cart site, especially considering it appears to be hosted in the UK! B)

[quote name=‘Struck’ timestamp=‘1314499852’ post=‘120493’]

No, that is not correct!



For starters, you need to go back a step and mention what version of CS-Cart you are actually running and which Cache Method have you selected so that we can better help.







You are absolutely right in that 3-5 seconds page load time is eternity, however, I can assure you there are many Cs-Cart users including myself with page load times in the 1 to 1-1/2 second range (or faster)! ;)



Here is an example of one bloody fast CS-cart site, especially considering it appears to be hosted in the UK! B)



http://www.ecopolar.com/

[/quote]



Thanks for your replies. I am using CS-CART: version 2.2.1 PROFESSIONAL. Using standard file cache right now no changes out of the box install. Hope that helps you to advise me further :)



BTW: What is your site and what server do you host with?

You could also go the extra step and install Smart Optimizer. This will minify the myriad css and js files, concatenate them, and i think it also caches the php or gzips it or something. Definitely a big performance boost there. Our site grade on gtmetrix went from a D to a B after installing Smart Optimizer.


[quote name=‘solesurvivor’ timestamp=‘1314502515’ post=‘120495’]

Thanks for your replies. I am using CS-CART: version 2.2.1 PROFESSIONAL. Using standard file cache right now no changes out of the box install. Hope that helps you to advise me further :)



BTW: What is your site and what server do you host with?

[/quote]

Get a good host, install smartoptimizer, up cs-carts memory usage to at least 128MB, compress your pictures well, use sqlite caching and cs-cart flies. Especially after version 2.1.3 (I think), speed is no longer an issue with cs-cart (well, the admin could be faster!).



How to sqlite, see CS-Cart Documentation — CS-Cart 4.15.x documentation



More how to, check my post here: Thanks everyone for your help, I am launched! - General Questions - CS-Cart Community Forums



If you want to score even higher on google page speed (I score between 93 and 96) turn on googles modpagespeed: GitHub - apache/incubator-pagespeed-mod: Apache module for rewriting web pages to reduce latency and bandwidth. → If it slows your site down, you don't have enough CPU power / memory.



Make 2 .htaccess files, one with smartoptimizer and modpagespeed turned on, and one with them turned off. Use the last one when editing templates and stuff like that so you will see your changes instantly.



Good luck!

[quote name='Flow' timestamp='1314517683' post='120500']

Get a good host, install smartoptimizer, up cs-carts memory usage to at least 128MB, compress your pictures well, use sqlite caching and cs-cart flies. Especially after version 2.1.3 (I think), speed is no longer an issue with cs-cart (well, the admin could be faster!).



How to sqlite, see CS-Cart Documentation — CS-Cart 4.15.x documentation



More how to, check my post here: Thanks everyone for your help, I am launched! - General Questions - CS-Cart Community Forums



If you want to score even higher on google page speed (I score between 93 and 96) turn on googles modpagespeed: GitHub - apache/incubator-pagespeed-mod: Apache module for rewriting web pages to reduce latency and bandwidth. → If it slows your site down, you don't have enough CPU power / memory.



Make 2 .htaccess files, one with smartoptimizer and modpagespeed turned on, and one with them turned off. Use the last one when editing templates and stuff like that so you will see your changes instantly.



Good luck!

[/quote]





Thanks! It seems that turning on SQL Lite minimizes load speed down to less than 2 seconds. Once I switch hosts and have a higher memory VPS I will check into the other items you mentioned.



Once again does anyone know what the lifespan of the cache is? For example: If we run a database update automatically using SQL when would the website refresh with the new data? I would hate to have to do that manually every 24 hours.

There is no lifespan of the cache. There are certain actions that trigger a cache-flush in the system like installing/uninstalling an addon, etc. Other than that, it's a manual operation and really shouldn't need to be done at all. It's not a real cache. I.e. it does not look at timestamps to figure out whether to re-fetch or not and there is no automated expiration, etc. that one would expect from a real cache.



There are basically 4 caches in the system.

compiled - compiled versions of your pages a the (possibly) hundreds of smarty templates are all compiled together to give you one page.

cache - basically the system settings and other db type operations (Features, Filters, etc.) This is the one that is updated the most when things like product details or system settings change or filters/features need to be rebuilt.

thumbnail - Thumbnails are now also cached (I'm not sure where and I've only need to flush it once via ?tc).

blocks - Blocks containing static info (html blocks, manual product/category blocks, etc.) are also cached.



Update: Quick look indicates that the thumbnail caching has gone away. But they could have moved where it's done from… Just not where I expected to find it (init.php).

Thank you for that thorough explanation. That helps me to understand CS-Cart Cache feature more clearly.