Mojo 9 cache #1784
Replies: 4 comments
-
Mojolicious caches are only in-memory, so if Morbo restarts there is nothing left of it. Are you maybe fighting with a browser cache? |
Beta Was this translation helpful? Give feedback.
-
To follow on with what kraih just said, SHIFT+Reload doesn't always reload everything. Open chrome dev tools and under network check the disable cache checkmark. With it set like that and while dev tools is open it will not cache anything in the browser. |
Beta Was this translation helpful? Give feedback.
-
Or probably open the devtools and long press the refresh button and chose "Empty Cache and Hard Reload" and see if it helps |
Beta Was this translation helpful? Give feedback.
-
Finally I found it ! We were checking the environment variable MOJO_MODE to set the templates directory |
Beta Was this translation helpful? Give feedback.
-
I have a Mojolicious Lite project in Mojo 8. I am testing in Mojo 9 and it works great. I am puzzled by some cache that I can't get rid of.
I was running Mojo 8.33 on Ubuntu 20.04. Then I created a package for Mojo 9.17 with dh-make-perl from CPAN.
I am using morbo to run in development mode. When the new Mojo renders a page it kind of gets cached, changes in the template file won't show up. Even though morbo tells something has changed and it is restarting changes are just not there.
If I stop morbo, install Mojo 8, and I run it again, it works fine. If I come back to Mojo 9, it renders the old template.
I tried setting
app->renderer->cache->max_keys(0);
as I read out there also I tried this:*Mojo::Cache::get = sub { };
Now, if I render a new template, and then I change it, it refreshes. But, templates I rendered before I added those two settings stubbornly keep showing old contents.
Yes, I tried another browser and also SHIFT+reload like there is no tomorrow. What puzzles me most it is I am running with morbo, so templates should be reloaded as soon as are changed. I checked if I had to add some flag to it but it looks by default it is running in development mode.
So I am really sorry because I bet I am missing something obvious, I searched in the documentation and discussions without any luck.
Any hints ? Thank you.
Beta Was this translation helpful? Give feedback.
All reactions