Issues With Smarty Caching

I have been trying to troubleshoot issues with our CS-Cart setup. We were having issues of only being able to handle 2 or 3 users before the Apache process shot the CPU server usage to 100%.



Through PHP profiling I was able to see that the two things causing high CPU usage are LESS compiling and Smarty Template related functions.



I disabled LESS compiling and used a static CSS file and now I can get to about 20 users before the server CPU’s reaches 100% and at 25-30 it starts to reject users.



The problem it seems that the caching system for Smarty is not working correctly, so it insists on regenerating everything every time an user loads a page.



Following the instructions in the Smarty Docs (e.g. Chapter 14. Caching | Smarty) and other sites, I have tried to enable caching and adjust the compile_check . The result has been that it breaks the layout if caching is set to 1 or 2 and makes the site unusable. Parts of the header repeat like three times and then it exits.



The only way I can get the site to load is by setting caching to 0.



Any idea why its doing this?

Hi,

The issue you are saying its of server setup issue. Its not with the cs-cart.

If you still face this issue. Feel free to contact us at support [at] kartpay.com . We would fix it for free if its minor one.



Thanks,

Mithilesh

My bet is that you have underlying permissions/ownership issues on your site where the cache is NOT being created because of permissions. Hence every page load goes through the process of trying to create the cache but it silently fails.



You should turn off the setting in the Design menu that forces recompile of less for each page. Once it's compiled (and the cache is working correctly) it becomes static.



Both of your issues are related to the same root cause.