Hey team,
I'm building a toy project with Phoenix on Windows 7 (I know, I'm sorry) and am running into an issue where static files from the priv/ folder are very stubbornly cached. I'm using Phoenix 0.8, Elixir 1.0.2, and Erlang 6.1.
The issue is that, as I edit my css, save, and reload in the browser, using mix phoenix.server to serve from localhost, I'm not seeing the changes being reflected at all. I've tried clearing my browser cache but the version of the file being sent to the browser continues to be the old one. Even stopping the phoenix.server task and starting again has no effect.
I've also set cache_static_lookup: false in my config but I'm not sure if this is related.
It seems like making a change in code, such that files are recompiled, fixes the issue. But when I'm working on front-end design I won't be touching the back-end code for long stretches, so this isn't really a viable solution.
Apologies if I've overlooked something simple. I can also migrate to a Linux dev environment instead if silly old Windows is the issue.
Thanks!
This is a bug on Windows which we are going to be fixing soon with Elixir v1.0.3. I can build a precompiled for you soon so you can try things out before the release. It would actually be a very welcome feedback! :D
Fantastic, I'm up for it — let me know when ready and I'll give it a spin.
A hot precompiled zip coming out of the oven: https://dl.dropboxusercontent.com/u/4934685/v1.0.3-dev.zip
Read this if you have questions how precompiled packages work: http://elixir-lang.org/install.html#2-precompiled-package
Feel free to ask here if you have other questions!
It works! Hooray!
Thanks very much for the prompt fix and the freshly baked 1.0.3 build. Looking forward to building many more things with Elixir :)
hello!
very interesting... I'v got very similar problem on ubuntu 14.04
making a toy app
and app.css file is jumping to the old state after server stop/start
using Phoenix 1.1.4 , Elixir 1.2.3 and Erlang/OTP 18
it was Ok from the beginning and I add some changes to the css
but suddenly after adding some code it just stoped working...
I mean it is changing the style "on the fly" then I am changing css, but after server reload I have my old app.css back for some reason
(sorry if I am asking something easy to solve, just learning)
thanks in advance!
I don't know that this is the same issue, BUT.. I added /web/static/assets/js/foo.js as a test, and found I could retrieve it. I deleted it, recompiled the app and it still shows up. Because it was copied into priv/static. Deleting everything under priv/static cleared everything up, but I felt dirty doing it; I wasn't sure when I did it if that was the appropriate thing to do. Seems like it might be worth having a mix task like "phoenix.clean" that might do the same thing (and any other housekeeping necessary), just to make it an "official way of clearing things out".
Most helpful comment
I don't know that this is the same issue, BUT.. I added /web/static/assets/js/foo.js as a test, and found I could retrieve it. I deleted it, recompiled the app and it still shows up. Because it was copied into priv/static. Deleting everything under priv/static cleared everything up, but I felt dirty doing it; I wasn't sure when I did it if that was the appropriate thing to do. Seems like it might be worth having a mix task like "phoenix.clean" that might do the same thing (and any other housekeeping necessary), just to make it an "official way of clearing things out".