You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default kamal doesn't allow writing to the public dir. I recommend changing the default dir to something writable when using the default dockerfile and kamal.
- Add dependency on actionpack-page_caching
- https://github.com/rails/actionpack-page_caching
- Needed to `chown` the `public` directory from `root` to `rails` to prevent a permissions error when the page cache attempted to read or write to the cache files
- `Errno::EACCES (Permission denied @ rb_sysopen - /rails/public/blog.html)`
- rails/actionpack-page_caching#72
- Despite the wiki below stating that I'd need to update my nginx.conf to serve the cache files, that step was not strictly required, since `config.public_file_server.enabled` is true by default.
- https://github.com/rails/actionpack-page_caching/wiki#nginx
- https://guides.rubyonrails.org/configuring.html#config-public-file-server-enabled
- I confirmed via logging and inspection of the csrf token that the cached pages are successfully served without the rails server recreating the page (after the first time).
- In a follow-up commit, I will disable the rails public_file_server flag in favor of nginx serving those public files
- I verified that the entire page cache is effectively invalidated on redeployment/recreation of the site container. Since the public folder is not backed up to any named volume, all changes made to it while the container is running (e.g. page cache entries) are blown away when the container is recreated.
By default kamal doesn't allow writing to the public dir. I recommend changing the default dir to something writable when using the default dockerfile and kamal.
Workds better.
The text was updated successfully, but these errors were encountered: