Deciphering the SugarCRM Cache Directory

sugarcrmdevelopers —  August 30, 2011 — 9 Comments

UPDATE ( 2013/01/28 ) – See this article for updates to how the cache directory is used now in Sugar 6.5

What is the cache?

The cache is used as a temporary storage for the CPU to retrieve at a later date. This helps to speed up the process of memory access and memory reallocation. Without it, the process of data retrieval and processing becomes much slower.

In SugarCRM the cache works in a similar manner, but it instead focuses on storing important software related files as well as storing temporary data relevant to a specific user. The cache directory is located in the root directory of your SugarCRM instance, you will find a cache directory. Looking into it further, you will notice that there are various types of sub-directories for specific types of data. I will help guide you through each sub directory and explain what purpose it serves and hopefully help give you a better understanding of the cache directory in general. Keep in mind, a lot of these directories and files are important, so you shouldn’t modify them or alter them unless you have knowledge on the cache already or a good understanding of what you are actually doing. On top of this, some of the files are hard copied to various folders in the cache and deleting them will delete the files on your SugarCRM database as well. So it’s generally better to leave things as is unless you have a good idea of what you are doing. Also, make sure your web server user has full write access to this directory.

Cache directory sub directories

The list of sub directories under the cache should look similar to the above. Please note there may be a few that won’t appear or be used depending upon your flavor and how you use SugarCRM.

This directory is used to encrypt and store your passwords. SugarCRM will use this directory to decrypt your passwords as well. Here’s an example of what information being stored here will look like.
Blowfish Directory Deleting the information stored here is bad, since SugarCRM uses this folder in the decryption process, it will no longer know how to decrypt your password. Also, it should be noted that there are plans to move the blowfish directory into the database itself, so it’s a high possibility that you wont need to concern yourself with this directory in future releases of SugarCRM.

This directory is used to store the temporarily created CSV files ( CSV meaning Comma Separated Values ) when sending out scheduled reports via Scheduler.

Dashlets can be seen on your main sugarCRM page. Take a look at your main sugarCRM page and you should notice an add dashlets button at the upper right corner. This will allow you to add more dashlets to your main page.

The cache stores all of the dashlets as you can see in this picture here: Dashlet directory
This directory contains all of those dashlets that are located in the “Add Dashlets” menu.

This was used in the past by the Feeds module that existed in Sugar 5.2 and earlier, but no longer is used. You can safely delete this assuming you are using an up to date version of the software.

The image directory is used for storing the image files that you attach to e-mails.

This directory is used to store the temporary files created by the import tool.

This is currently used to store cache files created by the External API ( two files created are externalAPI.cache.js and externalAPI.cache.php ).

The JS stands for javascript and this directory contains all of the language files for sugarCRM in a javascript format for being used by client-side javascript code. If you open up the directory, you can see it contains a folder for every module that exists inside of your sugarCRM database. Each of these folders contains important data for each of the given modules.

This directory isn’t really relevant anymore unless you are using an older version of SugarCRM, specifically version 4.0.1 or older. Due to changes in the structure of the software, custom layouts are moved to the “custom” folder in another directory, outside of the cache.

The module directory is a fairly large directory. It contains information for every module in the database. This information includes items such as variable definitions, class definitions, formats, and a language folder for defining global variables. Most of the definitions are contained in a vardef file which is defined through a dictionary. One of the directories that you should take note of is the Emails directory. It is a dynamic folder that contains information from the e-mails that you send through the SugarCRM interface. It is important not to mess with the values contained inside of this folder, since they are linked to the unique users using the interface.

This was used by the EZPDF library in SugarCRM 6.1.x and earlier ( and also exists on 6.2 and later instances upgraded from 6.1.x or earlier. You can delete this if you aren’t using this library

This is used by the TCPDF library added in SugarCRM 5.5.

Smarty is a template used for php. The smarty template is mainly concerned with formatting (specifically readability) and functionality. It uses smarty tags, which consist of brackets, quotes, other delimiters used in programming that you may be familiar with, as well as functional statements such as loops and if statements. The smarty template also incorporates a lot of the html formatting, that you may or may not be familiar with. The smarty cache directory in SugarCRM contains the hierarchy for the smarty template used in this software.

This is used to store the concatenated CSS, JS, and other assets used by the various themes. If you are seeing problems with your screen display ( such as missing images, wrong CSS layout, etc ) delete all the files in this directory.

Anytime you download, attach, or upload files using sugar, the information will be stored here. Think of it like the images folder that we already discussed above. The files are all encrypted and they are stored into this directory. Thus, you do not want to delete the data here because you will lose the information stored on your database as well.

It is also used for the Module Loader when installing new module packages into your Sugar instance. Again, you want to make sure not to delete these files since it could hinder the ability to uninstall these packages in the future.

Now going back to the dashlets, one of the menus deals with various types of graphs. The graphs are built as XML types and they will be stored into the corresponding directory under the cache.

Special thanks to Sander Marechal for his article on the SugarCRM cache directories.

9 responses to Deciphering the SugarCRM Cache Directory


    Thanks for the update!! 

    What about an article specifying all the DisplayParams available, that magic is kinda hidden and is very useful !



    I come frequently to this article for quick reference, what about an update now that Sugar CE 6.5.0 is out, thanks.


    It is good to hear that the blowfish directory is being moved out of this structure – what would be even better is hearing that everything that an instance relies on is stored somewhere else (or at least can be configured to point somewhere else as per upload directory)

Trackbacks and Pingbacks:

  1. Cache Folder Purpose - SugarCRM Forums - January 31, 2012

    […] […]

  2. Ever wonder what is located in each of the #SugarCRM directories - May 27, 2012

    […] […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s