What is the "var" folder used for?

In the past 3 weeks somehow my “var” folder under my file manager in host monster has accumulated over 100,000 files.



This has put me over my file limit in hostmonster,



I need to find out exactly what the “var” folder is used for.



Is is basically temp files and cache files?



Can most of the stuff in there be deleted?

var stores all the cart cache, master skins repository, database backups, update files and update backups.



[color=#555555][font=Arial, Helvetica, sans-serif][size=3]Please try cleaning up the template cache. In order to do it open this link in your browser: [/size][/font][/color]http://www.your_doma…om/admin.php?cc[color=#555555][font=Arial, Helvetica, sans-serif][size=3] where “www.your_domain.com” is the address of your store and where [/size][/font][/color]admin.php[color=#555555][font=Arial, Helvetica, sans-serif][size=3] is a script file for the administration panel of your store that was renamed for security reasons.[/size][/font][/color]



[color=#555555][font=Arial, Helvetica, sans-serif][size=3]If this fixes it you have a bigger issue with your hosting, as the cart cache is needed to speed up the cart and will build up lots of files. This is generally a good thing. You can try switching to sql_lite cache method instead of file method if needed.[/size][/font][/color]

[quote name='Triplets' timestamp='1356806613' post='151915']

var stores all the cart cache, master skins repository, database backups, update files and update backups.



[color=#555555][font=Arial, Helvetica, sans-serif][size=3]Please try cleaning up the template cache. In order to do it open this link in your browser: [/size][/font][/color]http://www.your_doma…om/admin.php?cc[color=#555555][font=Arial, Helvetica, sans-serif][size=3] where “www.your_domain.com” is the address of your store and where [/size][/font][/color]admin.php[color=#555555][font=Arial, Helvetica, sans-serif][size=3] is a script file for the administration panel of your store that was renamed for security reasons.[/size][/font][/color]



[color=#555555][font=Arial, Helvetica, sans-serif][size=3]If this fixes it you have a bigger issue with your hosting, as the cart cache is needed to speed up the cart and will build up lots of files. This is generally a good thing. You can try switching to sql_lite cache method instead of file method if needed.[/size][/font][/color]

[/quote]



I actually did the “?cc” thing yesterday and Im still way over the file limit.



Under var/cache/registry there are a whole bunch of these files:



“block_content_18_45_categories_44_11168_categories”



I cant even get into them cause there is so many of them and is taking 5 minutes for me to even get into a location.





What can be deleted under the /var folder?

You can delete anything in the cache directory. But next time one visits your site the cache will begin to rebuild again.





If for some reason your host has a file limit, change the caching type to sqlite or mysql.



To do it:

[list]

[]In the root directory of your CS-Cart installation, open the config.local.php file.

[
]Find this part of the code:



// Cache backend

// Available backends: file, sqlite, mysql, shmem

$config['cache_backend'] = 'file';

[*]Replace file in this line of the code:



$config['cache_backend'] = 'file';

with the necessary variant, for example, with mysql:



$config['cache_backend'] = 'mysql';

[/list]

[quote name='Triplets' timestamp='1356809500' post='151918']

You can delete anything in the cache directory. But next time one visits your site the cache will begin to rebuild again.





If for some reason your host has a file limit, change the caching type to sqlite or mysql.



To do it:[list]

[]In the root directory of your CS-Cart installation, open the config.local.php file.

[
]Find this part of the code:



// Cache backend

// Available backends: file, sqlite, mysql, shmem

$config['cache_backend'] = 'file';

[*]Replace file in this line of the code:



$config['cache_backend'] = 'file';

with the necessary variant, for example, with mysql:



$config['cache_backend'] = 'mysql';

[/list]

[/quote]



Okay I did that and saved the file.



I emptied out the rest of the cache. But what about the other folders in there such as database, downloads, exim, skins_repository, snapshots, and upgrades?



Also what exactly does that code you told me to change do?



[color=#ff0000][size=5]Also I had a file count done on my file manager and the /var folder has 151,911 files[/size][/color]

Every time you upgrade to a new version of CS-Cart, a full backup of the original and new version is completed and stored in /var/upgrade/ in folders named similar to “upgrade_2.2.2_professional-2.2.3_professional.tgz”. Each 'backup' and 'package' folder inside the upgrade folders will account for at least 10,000 files.



As this file limit is mission critical for you, I would suggest removing the old versions of these folders, perhaps keeping the most recent upgrade folder if you have recently upgraded and may need to roll-back.

Remove things via the Admin panel versus FTP or SSH unless you really know what you are removing. Using the Admin Panel will also adjust any DB references to those files that may exist and only remove what's needed and not inadvertently remove exim files, etc. I.e. you can go to Administration/Upgrade Center and then click the link to remove the backup files for any prior versions that have been upgraded. You might want to keep the most recent for reference.

[quote name='tbirnseth' timestamp='1356902746' post='151960']

Remove things via the Admin panel versus FTP or SSH unless you really know what you are removing. Using the Admin Panel will also adjust any DB references to those files that may exist and only remove what's needed and not inadvertently remove exim files, etc. I.e. you can go to Administration/Upgrade Center and then click the link to remove the backup files for any prior versions that have been upgraded. You might want to keep the most recent for reference.

[/quote]



I did some treaking with some files, called my host and did some optimizing of the site.



Our file count was at 343.240 and is now at 163.976 so we are back in the safe zone! Appreciate the help!

exim stads for export/import.

The csv files were probably generated in an export or from running the Google Merchant export.

AH ok.



Triplets:



That code you told me to change in one of the above post:



[color=#ff0000][font=arial, verdana, tahoma, sans-serif]Replace [/font]file[font=arial, verdana, tahoma, sans-serif] in this line of the code:[/font]



[font=arial, verdana, tahoma, sans-serif]$config['cache_backend'] = 'file'; [/font]

[font=arial, verdana, tahoma, sans-serif]with the necessary variant, for example, with [/font]mysql[font=arial, verdana, tahoma, sans-serif]:[/font]



[font=arial, verdana, tahoma, sans-serif]$config['cache_backend'] = 'mysql';[/font][/color]





[color=#282828][font=arial, verdana, tahoma, sans-serif]Would this at all slow down the site at all? I changed it to mysql. [/font][/color]

[color=#282828][font=arial, verdana, tahoma, sans-serif]mysql might because now you have tons more sql queries. Most people prefer sqlite.[/font][/color]

I ask this because my website now is taking 18-20 seconds to load 1 page, any page.

\This just started happening a few days ago.



Check this out here of the test:



http://www.webpagete…_HAK/1/details/



This is interesting too.

It said I basically failed on Cache static content.



WebPageTest Test - WebPageTest Optimization Check Results

[quote name='harpersmoto' timestamp='1357230001' post='152123']

I ask this because my website now is taking 18-20 seconds to load 1 page, any page.

\This just started happening a few days ago.



Check this out here of the test:



http://www.webpagete…_HAK/1/details/



This is interesting too.

It said I basically failed on Cache static content.



http://www.webpagete…_static_content

[/quote]Hey,





I had the same problem before, and I let my hosting company know and they took care of that problem. The problem was [color=#282828][font=arial, verdana, tahoma, sans-serif]mysql, so they repaired it.[/font][/color]

[quote name='tom437' timestamp='1357230617' post='152125']

Hey,





I had the same problem before, and I let my hosting company know and they took care of that problem. The problem was [color=#282828][font=arial, verdana, tahoma, sans-serif]mysql, so they repaired it.[/font][/color]

[/quote]



Ill call them again and talk to them.



They didn't say anything was wrong yesterday and maybe I can push them.

Ill post up an update here in a few.



UPDATE:



They said they couldn't notice anything on the server wrong but did notice the site really being slow so they submitted a ticket to the higher up techs

[quote name='harpersmoto' timestamp='1357231911' post='152126']

Ill call them again and talk to them.



They didn't say anything was wrong yesterday and maybe I can push them.

Ill post up an update here in a few.



UPDATE:



They said they couldn't notice anything on the server wrong but did notice the site really being slow so they submitted a ticket to the higher up techs

[/quote]Let see what the higher techs will tell you. My hosting company took care of it right away. Don't use they live chat, they don't know what to do.

[quote name='tom437' timestamp='1357258879' post='152144']

Let see what the higher techs will tell you. My hosting company took care of it right away. Don't use they live chat, they don't know what to do.

[/quote]



I always call them. Live chat takes to long ha.



Ill update with more information when it becomes available.

[quote name='harpersmoto' timestamp='1357339842' post='152195']

I always call them. Live chat takes to long ha.



Ill update with more information when it becomes available.

[/quote]Hey,



Did you never get it to work?