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
    
    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题