Smarty Template Cache makes store slow and then inoperable

Ever since installing CS-Cart version 2.0, we have experienced 30 second to 5 minute load times per page. The lack of performance and speed has been killing our sales. In running tests, we have found that Category pages display slowly, Product pages display even slower, but clicking the ‘Add to Cart’ would bring the cart to a screeching halt. After running the store updates, re-installing on a fresh copy, and performing database optimization, we have discovered the culprit to be linked to the Smarty template cache.



WE FOUND A SOLUTION that will fix the slowness immediately; Simply run ‘/index.php?cc’ to clear the cache. From that point on, the store is fast and fully functional. But, after a few hours, we notice our server’s CPU maxing out, page loads become really long, and sales begin to halt. Our temporary solution is to schedule task that periodically clears the cache many times per day.



Has anyone else experienced this situation? Does anyone know why the template cache would be causing a negative effect on performance, particularly the ‘Add to Cart’ function?

The way Smarty (The Templating Language (on top of PHP)) functions (in particular to CS-CART) makes it so the software is ‘cached’. In other cases, such as websites that have rare-changing content, or content that never change, this would be optimal, but the way CS-CART utilizes this function really slows down the loading and system as a whole.



One suggestion we can make is to run a CRON Job (to clear out the cache directory) every 30 minutes - 1 hour. Whichever works best for you.

[QUOTE]Ever since installing CS-Cart version 2.0, we have experienced 30 second to 5 minute load times per page.[/QUOTE]



He has something else seriously wrong to be seeing these page load times!



Exactly which CS-Cart version are you now running?



Add this to the end of your store url to display your version: ?version

You may also want to consider installing Smartoptimizer on your site, simple to install & quite effective, this post talks of it:

[url]http://forum.cs-cart.com/showthread.php?t=13623&highlight=smartoptimizer[/url]



Several of us on this forum are running this with definite speed improvements.



Regardless, the page times you mentioned are still far from what is typical for a normal CS-Cart install.

We are running version 2.0.10. The website is: www.floridagunexchange.com if you’d like to see it in action.



The typical behavior is the page will load about 99% of the way and then there is a noticeable lag time before it reaches the ‘Done’ status. Keep in mind that right now we are clearing the cache out every 10 minutes, so it is not really that slow anymore. The lag time is still noticeable particularly on the product view pages.



The really puzzling part is why clicking the ‘Add to Cart’ button gives us the most trouble. It is AJAX-based so why would it involve the template cache anyway?



We will try the SmartOptimizer and see what improvements we can make.

[quote name=‘tjordan’]We are running version 2.0.10. The website is: www.floridagunexchange.com if you’d like to see it in action.



The typical behavior is the page will load about 99% of the way and then there is a noticeable lag time before it reaches the ‘Done’ status. Keep in mind that right now we are clearing the cache out every 10 minutes, so it is not really that slow anymore. The lag time is still noticeable particularly on the product view pages.



The really puzzling part is why clicking the ‘Add to Cart’ button gives us the most trouble. It is AJAX-based so why would it involve the template cache anyway?



We will try the SmartOptimizer and see what improvements we can make.[/QUOTE]



Hi



Been on your site. I am using Firefox and the page load is very quick. I had this problem a while ago and it was just when I visited my site, I can’t remember what the problem was but i was told by other people it was quick loading so I didn’t worry.



You have an over width problem on the home page with the “featured products” they go way to the right.



PS Looks like you have more guns in your shop than we have in the whole of the UK LOL

I see some template design issues when viewing in IE8, one or more of these may be slowing up the page loads. And man, those are the longest product titles I have ever seen! :wink:



BTW, where is you site currently hosted at?



Dont ever expect a super fast CS-Cart site on a $5.00/Month **** bubblegum hosting account! :slight_smile:

That’s odd, they “Bleeped” me! :smiley:

[quote name=‘Struck’]That’s odd, they “Bleeped” me! :D[/quote]

It’ll bleep you again if your are not careful !

But Jesse, I am not a criminal! :wink:



Just a bit high strung at times, LOL

We host on a dedicated Windows 2003 server. Its a Xeon 2.4GHz with 4 GB of Ram. We host many CS-Cart stores on it, but none are v2.0 and none receive the traffic that this one sees. It (www.floridagunexchange.com) has around 500 visitors/day.



Yes, we have very long product names. We import all of our product data from our supplier’s database and we keep lots of descriptive data in there for SEO purposes.



Struck, you mention template design issues when viewing in IE8. Do you mean just browser compatibilty issues or actual improper coding in the pages?

Hello Tjordan,



If you check the validation of your home page it is showing like 130 errors & 100 warnings. This will have an effect on your site speed.



[url]http://validator.w3.org/[/url]

[quote name=‘Struck’]Hello Tjordan,



If you check the validation of your home page it is showing like 130 errors & 100 warnings. This will have an effect on your site speed.



[url]http://validator.w3.org/[/url][/QUOTE]



Hi Struck Thanks for the refresher! I checked my home page and found 2 errors! FIXED thanks to you!!! :stuck_out_tongue:

Hi



I have been Validating all my Categories and random pages.



in a Category 2 x SubCategories have this error…


[quote]Line [COLOR=“Red”]882[/COLOR], Column [COLOR=“Red”]23[/COLOR]: document type does not allow element “style” here



The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error). [/quote]

# in red vary per product.

I have a SubCategory with 39 products each has the error and SubCategory has 40 errors so I assume error is with the SubCategory and is generating error in Products????

Any ideas? :)

[quote name=‘BarryH’]Hi



I have been Validating all my Categories and random pages.



in a Category 2 x SubCategories have this error…






in red vary per product.


I have a SubCategory with 39 products each has the error and SubCategory has 40 errors so I assume error is with the SubCategory and is generating error in Products????

Any ideas? :)[/QUOTE]

RESOLVED!!!!! :rolleyes:

Admin>Catalogue>Categories>(SELECT A CATEGORY)Layout>Compact list....

If ticked causes the problem!!!!!!! EDIT not sure now:confused:

EDIT it is only on PRODUCTS NOW

[quote name=‘tjordan’]We host on a dedicated Windows 2003 server. Its has Xeon 2.4GHz with 4 GB of Ram. We host many CS-Cart stores on it, but none are v2.0 and none receive the traffic that this one sees. It (www.floridagunexchange.com) has around 500 visitors/day. [/QUOTE]

Well there is your problem ---- WINDOWS :rolleyes:



Actually windows servers do perform very poorly compared to Linux based servers

but ignoring that, you might want to look at how your database server is configured and optimized as that will have the greatest impact in this case.


[QUOTE]Yes, we have very long product names. We import all of our product data from our supplier’s database and we keep lots of descriptive data in there for SEO purposes.[/QUOTE]

Long file names is not really a problem though if you have a large number of image files in the same folder, you might want to move those to different subfolders in smaller groups as this will help directory reading performance.

Hi



Hope I haven’t Hijacked this thread!



But I have resolved the bad pages. It is ALL caused by the TAGS Addon, if active then problems are generated on product pages, if disabled problem goes.



Will investigate further and let you know if I fix it!

Okay, we really appreciate all of the input, but let’s get back on track with the speed and performance issues. Here is an update on where we stand with our store’s (www.floridagunexchange.com) Smarty template cache problem.



We must clear out our store’s cache every 10 minutes or else the page load times become extremely long (30 sec – 5 min). The typical behavior is the page loads 99% of the way and then hangs up. Product detail pages are usually the slowest to finish loading, but clicking the ‘Add to Cart’ button makes the store virtually inoperable.



We installed and setup the SmartOptimizer on the store. We eliminated as many W3C errors as possible. We turned off the CS-Cart built in statistics.

This is NOT a hosting issue; We have a dedicated server that is plenty fast. This is NOT a Windows issue; All of our pre v2.0 CS-Cart sites don’t have this problem. This is NOT a MySql database issue; All database data is visible on the page before the pages hang. This is NOT a ‘TAGS’ addon issue; We have kept our TAGs disabled. The ONLY thing that has any effect on the load times is clearing the template cache.



WE BELIEVE THIS IS PRIMARILY A TEMPLATE CACHING ISSUE. Simply clearing the cache fixes all of our speed and performance problems.



Can anybody explain this, tell us how to fix this, troubleshoot this, tell us how to eliminate caching, or explain why clicking the ‘Add to Cart’ button brings the cart to its knees?

[quote name=‘tjordan’]Okay, we really appreciate all of the input, but let’s get back on track with the speed and performance issues. Here is an update on where we stand with our store’s (www.floridagunexchange.com) Smarty template cache problem.



We must clear out our store’s cache every 10 minutes or else the page load times become extremely long (30 sec – 5 min). The typical behavior is the page loads 99% of the way and then hangs up. Product detail pages are usually the slowest to finish loading, but clicking the ‘Add to Cart’ button makes the store virtually inoperable.



We installed and setup the SmartOptimizer on the store. We eliminated as many W3C errors as possible. We turned off the CS-Cart built in statistics.

This is NOT a hosting issue; We have a dedicated server that is plenty fast. This is NOT a Windows issue; All of our pre v2.0 CS-Cart sites don’t have this problem. This is NOT a MySql database issue; All database data is visible on the page before the pages hang. This is NOT a ‘TAGS’ addon issue; We have kept our TAGs disabled. The ONLY thing that has any effect on the load times is clearing the template cache.



WE BELIEVE THIS IS PRIMARILY A TEMPLATE CACHING ISSUE. Simply clearing the cache fixes all of our speed and performance problems.



Can anybody explain this, tell us how to fix this, troubleshoot this, tell us how to eliminate caching, or explain why clicking the ‘Add to Cart’ button brings the cart to its knees?[/QUOTE]



Steady on mate!



You have been a member of this forum for around 14 months and only posted 21 times, ALL questions I bet too!



Anyway, being rude or impolite is NOT the way to get help.



Most people on here offer help and ask nothing in return, so please try a little tact or you may find people ignore you!



I had a similar problem which turned out to be a simple change to the memory limit in config file.

Well, sounds as if you have been busy huh! :wink:



Every tidbit of advise that was given to you will at the least have some positive effect in the longrun in speeding up your site, so I don’t think you have wasted any time which is good.



So none of these changes have really made a noticeable difference so far?



If not, then you most likely have a skin or template issue “somewhere” that is hanging your site.