Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

JCKN123's avatar

Blade cache keeps restoring old views and routes

For Some reason, Blade Cache Keeps Restoring old views and routes, as well with controllers.

I tried

"php artisan view:clear"

This one doesn't solve my issue, I did this command so many times it stills shows me the old content.

Can some one help me on this.

0 likes
17 replies
newbie360's avatar

i had this issue too when use file driver, i tired any command still can't delete the cache files

you can check the cache files in project/storage/framework/cache/data

after changed to use CACHE_DRIVER=memcached in .env, i got very good performace

you can try use database driver too, but database and file driver not support use cache tag

JCKN123's avatar

i got this error,

laravel Class 'Memcached' not found

after i did php artisan cache:clear

Any solution for this??

Snapey's avatar

unless you have memcached setup you should be using file for the cache driver.

php artisan config:clear after changing the config

JCKN123's avatar

I tried the same @snapey , but for some reason, i still got the error,

In MemcachedConnector.php line 69:

Class 'Memcached' not found

I didn't setup Memcached, How can i iinstall Memcached on my server

Snapey's avatar

You don't need it. When / if you get to the point of needing to cache DATA you will know what it is and how to install it.

Views do not use the cache.

1 like
jlrdw's avatar

You can also write a batch file that clears the various caches. I run one after certain major program changes.

In the past, I have actually fixed a problem, but because of some cache did not realize problem was fixed.

Cache has got me more than once on this.

Batch file is only a suggestion.

JCKN123's avatar

@jlrdw can you help me out with this. How to resolve it.

Browsers keep caching the old controllers which they are not existing on the site. it works fine on all my browsers but when users coming to the website. For some reason its calling old controller methods.

jlrdw's avatar

After changes I run

cd\
cd C:\BitNami\wampstack-7.4.7-0\apache2\laravel80up  \\ change to yours
php artisan cache:clear
pause
php artisan config:clear
pause
php artisan route:clear
pause
php artisan view:clear
pause

Adjust as needed, also clear browser cache between code changes.

1 like
JCKN123's avatar

It works fine at local server and production server, Still for some reason. My Current Website USERS still accessing controllers that are not on the website. I deleted them all.

Is there any way we can force the browser need to call the website for every request instead of taking from cache.

Snapey's avatar

it will. Your browser does not know anything about your controllers.

1 like
JCKN123's avatar

@snapey Thanks but for some reason its calling old routes and views. even after i deleted them

jlrdw's avatar

@jckn123 if they are accessing wrong controllers, are you sure that's the correct site you have them on.

Also you're not developing on a live site are you? Code on a development site, and push to production. Have you also implemented laravel mix.

1 like
JCKN123's avatar

@jlrdw it works perfectly fine at developing site when i push the changes to production. Still, Some users are getting old content.

I run all PHP artisan commands, Still No use. :(

Thanks

jlrdw's avatar

That is definitely a new one on me, I'd say go in and delete those temporary views manually.

When you push to production make sure all that temporary stuff is cleard first.

Also give the chapter in the documentation on deployment a good read.

johnvoncolln's avatar

I'm facing a similar problem. Just updated my php version from 7.3 to 7.4 on forge aws server, so now whenever I make some changes to a blade file, push to prod, run artisan view:clear, the cache files get deleted, but the view in browser doesn't change.

Also, I cleared view cache, visited a page, looked back into storage/framework/views and find the cached file for the page I visited. Took note of the filename. Deleted it, reloaded the page in the browser, look back in storage/framework/views and the file has reappeared with the same filename.

The only way I'v found for prod to regenerate the cached view files is the delete them and restart the server. This is not a way to work.

Wiezo's avatar

i have this issue too, I have tried restarting the server, remove the cache, change browser, disabled PHP cache, change ports, but I still getting my old views. Im totally lost what to do now

Kells's avatar

I am also having this issue. In my app, I have a particular view that blade keeps restoring. I have so far made updates to the view, but the old one keeps getting restored. Whenever I clear the view cache and visit the route again, I see the old view and the deleted file restored in the storage directory. I went to my view config file and added a key to turn off view caching but this still keeps happening, so I am out of sorts. Does anyone have any working solutions to this problem? I have literally tried changing the cache driver, and I still do not have it fixed.

1 like

Please or to participate in this conversation.