M
M
MBodunov2020-03-21 11:41:09
Ruby on Rails
MBodunov, 2020-03-21 11:41:09

How to force clear the cache?

Good afternoon
I got a site written in Ruby on Rails, I'm trying to make simple changes in the views of the site, but until the cache is deleted, these changes do not appear. I don't know much about Rails. How to make it understand that, for example, the index.html.haml file has changed and the cache needs to be rebuilt?
I even tried to disable the cache in the config in \current\config\environments\production.rb and entered config.action_controller.perform_caching = false
But it had no effect. site pages continued to be taken from the cache, ignoring the fact that the file itself had changed

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Mirilaczvili, 2020-03-21
@2ord

In development mode locally or straight into production?
In order for the changes to take effect in production, you must restart the web server.
In a good way, you can not edit files directly in production. You need to fix it locally and deploy the application to the server.
I recommend reading about the basic principles of developing on RoR, so that later you don’t accidentally shoot yourself in the foot.

I
Ilya Ponomarev, 2020-03-27
@ilyario

Try running either the
`rake tmp:clear` task to clear the cache,
or run the command in the console to clear the cache
`Rails.cache.clear`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question