Deleting Heroku / tmp folder

From the Heroku Information Page on a Read-Only File System

"There are two directories that you can write: ./ tmp and. / Log (under your application root). If you want to temporarily delete the file for the duration of the request, you can write it to the file name, for example # {RAILS_ROOT} / tmp / myfile _ # {Process.pid}. There is no guarantee that this file will be present on subsequent requests (although it may be), so it should not be used for any permanent storage. "

Does anyone know how often files are deleted from the /tmp folder in Heroku?

+6
source share
1 answer

heroku never explicitly deletes files from your tmp folder.
However, it is not used between instances of your application (your speakers).

This means that you can assume that the tmp folder should be empty every time you deploy the application.
Since you should always be able to deploy, you need to independently build your application for this and do not rely on the tmp folder so that the files are longer than a custom HTTP request.

+7
source

Source: https://habr.com/ru/post/948032/


All Articles