donglan6777 2014-01-06 04:35
浏览 21
已采纳

为什么需要在Symfony2中缓存开发环境?

I am working with symfony2 on my OSX Mavricks. And I came with this cache thing in Symfony2 which needs to be cleared every time I type and save on any page on files on the application. But the sad thing is every time I clear the cache I also need to change the permissions of the cache folder.

Apart from that sometime even I clear the cache it takes time to reflect the change. I have followed the instructions on this site to disable the cache: http://symfony.com/doc/current/cookbook/debugging.html

Also I found some answers that caching is very important in dev-env otherwise symfony is very slow and takes time to reload. But for me it seems like: first clear the cache which takes at least 5 seconds -> then change the permissions -> then reload. Which means need to switch at least twice between the editor -> terminal -> browser which takes another 3 seconds (at-least). Does it makes sense to wait for like 10 seconds without switching and clearing cache and doing shit all time just to see the change made by removing semicolon in the code.

I believe it is a good practice to maintain cache for the production but for the development wait 10 seconds and switch all time does not make sense to me.

Or is it that I am doing it the wrong way. Any help could be very appreciated. But this seemed to me very annoying.

Any help would be greatly appreciated.

Thanks in advance.

  • 写回答

1条回答 默认 最新

  • duanshanduo3363 2014-01-11 14:47
    关注

    Ok now I figured out why I was having this problem. It was not actually the problem with the symfony2 but was due to the configurations on my php.ini which was located on /applications/mamp/bin/php/php5.5.3/conf/php.ini at the end of the tile.

    But regarding the permission problem I still don't have any idea why I need to change the permissions all the time. I tried quite much to sole but ended dis-configuring the permission settings of my MAC.

    [OPcache]
    ;zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/opcache.so"
    ;  opcache.memory_consumption=128
    ;  opcache.interned_strings_buffer=8
    ;  opcache.max_accelerated_files=4000
    ;  opcache.revalidate_freq=60
    ;  opcache.fast_shutdown=1
    ;  opcache.enable_cli=1
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度