doubinduo3364 2017-02-07 23:54
浏览 27
已采纳

Laravel - php工匠的观点是什么:清楚吗?

I run a command php artisan view:clear, as I followed a tutorial on custom 404 pages in Laravel, and as explained, the command Clears all compiled view files, further on I looked it up in laravel docs and it said that it removes the cache from view files. The reason why im asking this is because

  • im not sure if this effects my view files
  • Will they stay the same?
  • Did i remove something important running this command?
  • What are these cache files for?
  • Will this effect my future work?
  • 写回答

1条回答 默认 最新

  • dskm94301 2017-02-08 00:01
    关注

    This command basically just clears out all cached views.

    Rather than loading your view every time, a cached copy can be stored in your storage folder. View caching is done because blade compiling each time is a waste of time, as blade obviously turns the template in to a proper PHP file.

    By running php artisan view:clear you simply clear out all the cached views, and so next time the blade view is loaded it will be compiled again rather than pulling it from the cache.

    im not sure if this effects my view files

    This does not effect the views themselves, it simply clears the cached copies.

    Will they stay the same?

    Your views themselves will stay the same, yes.

    Did i remove something important running this command?

    Only the cached copies of your views. These will simply be compiled again when the page is loaded.

    What are these cache files for?

    To prevent blade having to compile every time it is called, it can be done just once to prevent wasting this time.

    Will this effect my future work?

    Not at all.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助
  • ¥15 STM32控制MAX7219问题求解答