📜 ⬆️ ⬇️

Static caching via expires and asset timestamps

To speed up page loading, you can set the expires header far into the future for static components.
However, there is one problem: you will have to change the file name or the path to it so that the user knows that the file needs to be re-read.

In Rails, there is a useful opportunity for assets timestamps , to be honest, I did not understand why this was necessary before.

Let's figure it out?
')
In order not to repeat, I will give a link to the article with a detailed description of the logic: Configure the Expires header for Rails under nginx

The general meaning is as follows:


UPD: Example in real config gist.github.com/14614

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


All Articles