Cache File

Hi Anyone,



I have a problem with cache system. Now, I use file cache, how to automatically delete cache file (var/cache)? Because the file continues to grow every day.



Thanks

Hi Andry



if you have a cpanel Hosting then go to Cron jobs (at the bottom) and set a new cron job.



You can set from the common settings once per day and below that ad this line




rm -rf /home/yourusername/public_html/var/cache/*



Replace the yourusername with your cpanel account username . Then hit Add new Cron job







In plesk is little bit different. Its called Scheduled Tasks and its located in the Websites & domains tab at the top.



You have to choose the user from the list and then click on Schedule New task.



You set the time (Minute, hour etc) and belowe is command where you copy this


rm -rf /var/www/vhosts/yoursite.com/httpdocs/var/cache/*



Replace the yoursite.com with your real domain . Then hit OK



Hope this helps



Fotis

I don't understand how a cache can grow larger then the size of the data on your site. If you plan to stop the cache caching all your site then you might as well stop it doing anything.

I have the same problem, huge cache and when I delete things they are still there for hours even after I delete the cache folder??? It takes forever to delete this folder via FTP. Anyone find a way or fix to solve this?

Well



this is a thing that already have been discussed in this forum.



Main thing to know is that cache volume is directly connected to number of users- blocks and mainly filters you have on your site. Filters are very intensive on caching.



If you open the var/cache/registry you ll see that the main volume of folders are pfilters… and block…



CS-Cart is creating those folders in order to cahce every possible combination. So its normal.



Read more here Inneficient File Caching - General Questions - CS-Cart Community Forums



Fotis

I concur about the maximum size of the cache. Note too that languages and/or currencies also impact the size of the cache. I.e. if you have 2 languages enabled, then each page will have a compiled version for each language. If you have 4 languages, then your caching is increased 4-fold.



One way to reduce the time it takes to clear a cache in real time is to simply rename it via FTP (I.e. change var/cache to var/cache1). Then go about removing var/cache1 when you can just let it run. Yes, doing this in FTP is slow. It's also slow to do it (on a large site) via the admin panel since it recurses all directories and removes each file, then the parent directory. You can end up with a 404 page because the underlying operation times out…