donglan6777 2014-01-05 20: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 06: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
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部