This project is archived and is in readonly mode.
render :file caches contents - doesn't reload until webserver reloaded
-
Rizwan Reza
- Milestone set to 2.3.6
- Tag changed from cache, caching, file, render to bugmash, cache, caching, file, render
-
Diego Algorta
- Tag changed from bugmash, cache, caching, file, render to bugmash, cache, caching, file, not, render
not reproducible
I tried with 2-3-stable branch and I was able to update my template file and see the changes in the browser without needing to restart the app.
-
Rizwan Reza
- State changed from new to invalid
-
Aaron Hamid
Diego, was it a file with a .css extension?
-
Aaron Hamid
not reproducible
-
Rizwan Reza
- Tag changed from bugmash, cache, caching, file, not, render to cache, caching, file, not, render
-
heldopslippers
It is reproducible.
I have te same problem. Running in development mode. And rendering a css file. When changing the file rails does not pick up on it.I have to say though that I am using it with an action (for very good reasons).
so for example I have this line of code in my application controller:
def css render :file => "#{RAILS_ROOT}/clients/#{client_id}/index.css", :layout => false endI am by the way running v 2.3.8
And really don't know if this helps (first time) But I hope it does! -
dxg
- Importance changed from to Low
Have exactly the same problem.
Rails 2.3.9, ruby 1.9.1p429, i686-linux, development mode, using 'script/server'<%= render :file => Rails.root.to_s + '/app/views/ab_mailer/newsletter.html.erb' %> -
Damon Cali
Same problem.
Rails 2.3.5, Ruby 1.8.7-p302, Snow Leopard, development env, WEBrick 1.3.1
-
obregoru
I have this same problem - to get around it, I'm currently using the render :text => File.open as recommend above, but this method but this is much slower in terms of performance.
I have html files in /public which has content that is changed regularly. I would like to be able to have the file cached, yet, be able to update or invalidate the cache on a timed/regular basis so that the file reloads and is rendered via render :file..
Using file open along with my own cache of file contents may work well in the short run, but really - what is the answer here??
-
Paintrick
I have the same issue in 3.0.4..
could it be a proxy cache or something
or is it really Rails caching the render :file part?Also, when I open the rendered file in another browser tab
but then without rails, I see the latest content.how does this work / happen?
thanks! -
tsailipu
Same in 3.0.5. I do know that this behavior doesn't happen in development mode and only on production mode.... Is there a way for us to clear in the code whatever is being cached?