Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to prevent missing images or assets after deployment in rails

oscarlopezalegre asked in Rails

I'm building a website as side project with a friend. Ngnix + Rails in docker.

After deployment, I usually do assets:clobber and assets:precompile. This changes the name of the assets.

When I try to visit my website I see that the HTML generated is still the old one (therefore image links are old). If I clean browser cache everything works as normal.

I disabled cache through header but still doesn't work. This is getting me crazy

Below is the request answer from curl

HTTP/2 200
server: nginx/1.19.1
date: Wed, 19 Aug 2020 15:44:16 GMT
content-type: text/html; charset=utf-8
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-download-options: noopen
x-permitted-cross-domain-policies: none
referrer-policy: strict-origin-when-cross-origin
etag: W/"945cd164e129dcfb2a5a8e2b17224688"
cache-control: no-cache
set-cookie: _certifications_session=OrFtsEO1PeEBjXgb6uzIyL90uq%2BTx4gZS5mn1QBRU%2FB7cjmc72SxvXxCH5rYNOenH%2BQWTazZMHt4pA%2FPnEDWkHLE4Yu1soS1gkQEr3slbg3g%2FxzaNogGykDj%2FXIfhIz4It6dPEXXz2wVkTCNk%2F%2FBS7HYvjsUraX%2FBQnzNstlUSGfeLIahiGVucnDv9mEuRtnl3bPXQYCju68QY%2Bu0aBkfsP8eqD9epM%3D--yMbor%2F8ylWt%2FKuMh--428Cx3jqKRbr9iWBHbDZGA%3D%3D; path=/; HttpOnly
x-request-id: b3f1f861-35f6-4b13-9e3b-5b723f79ab38
x-runtime: 0.474381
expires: Thu, 01 Jan 1970 00:00:01 GMT
last-modified: Wednesday, 19-Aug-2020 15:44:16 UTC

<!doctype html>

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 83,038+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.