那些很神奇的bug系列——2

在使用laravel进行的开发的过程中,使用blade的过程中总会出现一些看起来莫名其妙的bug

最近有遇到了一个比较坑的bug

由于看到网络上已经有人提问和回答的比较好了,我就不自己重写一遍了,直接引用过来

I am developing a Laravel(5.2.29) project in Windows environment and testing it on Chrome browser.

I have made some changes on a Blade file using atom text editor and then refreshed my page and noticed that suddenly it has stopped reflecting the changes (it's loading the old Blade file).

I've tried the following:

Restarted the browser
Clearing browser cache
Running php artisan cache:clear
Running composer dumpautoload
Deleting the Blade file (and got a view not found error).
Then created a new Blade file with the same name, with no >content and refreshed the page.
No matter what, the code displayed on the browser is >always the same (old) version and not the content of the >Blade file.

问题解决方案如下:

In order to avoid the parsing of Blade files on each reload, Laravel caches the views after Blade is processed. I've experienced some situations where the source (view file) is updated but the cache file is not "reloaded". In these cases, all you need to do is to delete the cached views and reload the page.

The cached view files are stored in storage/framework/views.

一句话总结就是,可能因为blade缓存的原因,所以当遇到明明自己更改了文件,但死活在浏览器刷新不出来,就可以吧/storage/framework/views下的缓存文件都删除掉


参考网站

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 10,083评论 0 23
  • 如何优化HTML5在移动设置上的性能表现,首先需要明确以下几个原则: 1、PC优化手段在Mobile端同样适用。 ...
    我的头好大呀呀呀阅读 365评论 0 0
  • 在向往的地方 留影 在美好的时候 留念 在生命里 想留存 能 一遍一遍 复习的纪念 上传是微笑 打开 是 空版
    粒粒蓝雪阅读 166评论 1 0
  • 舞阑人散,于亘古的黑夜里辗转,低沉的城市蛰伏着,蹲在暗处舔舐新鲜的血液。静寂之夜的狂欢!沧澜思绪的悲鸣! 万千星辉...
    苍术魂罗阅读 310评论 1 4