What files does Craft store in craft/storage/runtime/temp folder. And what is the purpose of it. And how to stop it form getting huge.


The easiest thing is to look it up. Craft CMS is usually really self-explaining So when you take a look at your folders in craft/storage/runtime/temp you'll see the following

/assets <- for example cached thumbnails/preview icons and all those things
/compiled_templates <- templates that have cache tags, that should only compiled once... for example static pages that does not change that much
/HTML <-- mostly some json objects
/logs <-- well seems obvious
/state <-- Yii.CSecurityManager.validationkey a json object

The compiled_templates folder could become huge when you messed around with cache tags too much or if you have a really large site. assets will grow when you insert many assets.

The purpose of this folder is to make Craft CMS faster because it does not have to generate HTML, thumbnails and so on with every page refresh, instead it uses already generated files.

How big is this folder for you? Does it require too much space?

  • 1
  • The site I am managing is pretty big and has lots of assets. but those assets are actually stored on amazon. so space for assets is not a problem. The temp folder used to get very big and take the website down by running out of space. but then i added a cron job to cleare the temp folder form time to time. after that I didn't have any issues. But recently the site went down and when i looked in the temp folder there was around 180GB one gif file. That was so strange , thats why I was wondering what exactly does craft store in temp folder. – Jahanzeb Khan Feb 13 '18 at 13:14
  • If it's really 180GB it's maybe a bug. You should contact Pixel and Tonic and report that. – Robin Schambach Feb 13 '18 at 13:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.