小编Phi*_*ppe的帖子

关闭MAMP中的缓存

试图在MAMP中关闭缓存以进行开发,等待缓存在进行小的更改后过期,这会降低我的工作效率.(当我更改为PHP 5.5.3时出现问题,更改回来并没有修复它)

在研究之后,我采取了以下步骤(未成功)禁用缓存:

注释掉php.ini中的OPcache行并重置mamp.(并尝试显示零值)

;zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/opcache.so"
;  opcache.memory_consumption=0
;  opcache.interned_strings_buffer=0
;  opcache.max_accelerated_files=0
;  opcache.revalidate_freq=0
;  opcache.fast_shutdown=1
;  opcache.enable_cli=0
Run Code Online (Sandbox Code Playgroud)

添加了PHP标头

   header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
   header("Cache-Control: post-check=0, pre-check=0", false);
   header("Pragma: no-cache");
Run Code Online (Sandbox Code Playgroud)

添加了html标题

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
Run Code Online (Sandbox Code Playgroud)

我还使用谷歌浏览器中的选项在开启开发工具时关闭缓存.

我迷失在这里,想不出我能做的其他事情来禁用缓存.

更改PHP - 或 - HTML代码后,我必须等待约2分钟才能生效.但是,数据库更改似乎立即生效,因此我认为它是服务器端opcache.

我需要禁用MAMP使用的另一个缓存吗?(或另一步?)

php caching mamp opcache

11
推荐指数
2
解决办法
9643
查看次数

标签 统计

caching ×1

mamp ×1

opcache ×1

php ×1