Silverstripe is a versatile content management system (CMS) that empowers you to build and manage websites with ease.
The silverstripe-cache folder serves a crucial purpose in your Silverstripe project. Here's why it's important:
Optimised Performance: Silverstripe generates and stores various temporary files to enhance performance and provides a better user experience. By creating a dedicated silverstripe-cache folder, you ensure that these files are organised and don't clutter other system directories, like the /tmp folder, which can lead to performance issues.
Easier Maintenance: Having a separate cache folder makes it easier to manage and clean up temporary files when necessary. It's especially valuable when troubleshooting or upgrading your Silverstripe installation.
Prevent Server Overload: If your temporary files accumulate in system-wide directories, it can lead to server overload, slowed performance, or even crashes. Isolating Silverstripe's cache files helps maintain a healthy server environment.
Creating the silverstripe-cache folder is a straightforward process. Follow these steps:
In this step, we need to ssh into the Container with the SSH user attached to the container.
Using your terminal, navigate to the root directory of your Silverstripe project. This is where your project's primary files are located, usually this should be the /container/application/
folder.
$cd /container/application/
In the project root directory, create a new folder, say silverstripe-cache. You can use this handy command:
$ mkdir silverstripe-cache
and assign it with the preferred permissions
$ chmod 0777 silverstripe-cache
Edit your .env file in your /contianer/application directory and add the following line;
SS_TEMP_PATH="/container/application/silverstripe-cache"
For Silverstripe to get the new changes, we need to restart the Container, you can do this via the Restart
option on the SiteHost Control Panel.
Your silverstripe-cache folder is now in place and ready to serve its purpose. Silverstripe will automatically use it to store temporary files and data.
By creating the silverstripe-cache folder within the root of your Silverstripe project, you're taking a proactive step to optimise performance, enhance maintenance, and prevent potential server issues. It's a simple yet effective practice that ensures your Silverstripe website runs smoothly and efficiently.