-
Notifications
You must be signed in to change notification settings - Fork 11k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Request] Option to disable cache #2501
Comments
Change cache driver to I know this isn't exactly what you want but it should work. |
See above 👍 |
This should be added on documentation. |
This does not seem to work in Laravel 5.2, I have solved this by setting ENV variable CACHE_EXPIRE to -1 which is then used to set how many minutes is cache valid, this stops caching globally. |
@cerw It did work here. Same version. Make sure you have this on your .env file: |
None of your solution work |
@vietnguyen09 perhaps you've cached your configuration (caching the .env), changing the .env has no effect until you clear the cached configuration. |
Proof - none of the solutions above worked:
and then
Laravel cache system is stupid - why the hell I can't disable caching simply turning it off? Or probably I must override BladeCompiler and set it as IoC - but why, these are all needless actions, please make it simple for us. |
@vietnguyen09 @arthurkushman I got the reason, try to disable the OPcache of php. It's work for me. |
@moonsn Thanks!!! It's work for me too. |
@moonsn what about if i don't have access to php? |
@engnaguib sorry, i don't know. did you sure that your Opcache of php status is enable? |
@moonsn i think it's enable because the laravel cache working |
We wanted this as well and tried the 'extend' the cache facade and gave up (I wish I could have that afternoon back) and ended up creating our own class (OurCache::) that calls Cache:: and adding our additional logic there. However and packages that use Cache::* (for example Entrust), you're screwed. Also, Laravel Cache has little or no opportunity for injection and not to mention, Facades suck. If anyone had tips on escaping the tyranny of facades, please let up know. |
The real problem here is that Library/Packages use them .. as well as global helper functions; isn't? IMO libs/packages should never do this but here we are. |
100% agree. |
this works in
|
@mrextreme's solution does not work for me in Laravel 5.8 ... Seriously, there is no way to disable view caching in the dev environment ? Changing the cache driver to |
@mrextreme's solution works fine for me on 5.8, except there is no need to add anything to a service provider - configuration only is enough. And that was enough even on 5.7.21. However this relates to cache facade. Blade caching is completely different. |
@moonsn Worked for me too ! Thanks |
@mrextreme . I have same issue, i done your suggest, but it is not work in Laravel 5.8. Please help me if you can. thanks |
Use this package, It will tackle all cache and clean it properly. |
The only thing that worked for me on Laravel 5.4 was to manually delete the cached views from the storage folder: |
So here is the problem that alludes most of us, the fact is; there are SIX caches in Laravel
How to clear all caches
How to re-cache almost everything (optimize)
|
So any news on this topic? |
If you are using MAMP, disable OPCache under Preferences, General, PHP-Cahce. just select off. thank me later. |
Being able to disable caching of routes when a application is in dev mode would be ideal. Running route:cache each time to clear cache when in development doesn't make any sense if the site is already in development mode. |
Simply do |
just tried this and this doesn't seem wo work in laravel 10 this is a huge problem when developing on shared hosting environmnts that cache files :( |
Started using cache for my project to improve performance and the inability to disable cache when needed in laravel 11 is hindering my progress. Any direct solution yet? |
I think it would be really useful to have an option to disable caching entirely -- or just do it when debug is set to true -- as it can cause headaches when developing. I'm surprised this doesn't already exist.
The text was updated successfully, but these errors were encountered: