Deployment Issue with Heroku I have a Drupal project on heroku and it works fine, until a dyno restart.
After that, the Css and Js on the Drupal site stop working.
Whenever that happens, I have to do a flush cache to get the site working. From my understanding, flushing cache creates files that Drupal uses for Css and Js. Since the storage system on Heroku is ephemeral, after dyno every restart I lose that file. Thus, I am forced to do a cache flush to get that file again and make everything on the site work. Is there a way around this?
Is there a way to change the folder location of the temporary file that is created?
I eventually got the site working by disabling caching. But better approach to this problem is, creating the site on your local instance first.
You need to create and install Drupal on your local system. If you install it directly on Heroku, it creates some temporary file on Heroku, which Heroku discards after every dyno restart. Even settings.php loses all the changes made to it(during installation) after dyno restart. (I installed my site directly on Heroku, so I got through this issue by adding changes to settings.php manually)
Once you create the Drupal site on your local instance (using the GUI), you will have some files in sites/default/files, as well as some changes in settings.php (hash salt, database setting etc). Now, you can track all these files and push it to Heroku.
The site should work fine, except you won't be able to store any public files, you will need S3 bucket for that.
Hope this helps who encountered similar issue!