简体   繁体   English

在 bitnami 灯堆栈上更改/保存 php 文件时的延迟效果

[英]delayed effect when change/save php file on bitnami lamp stack

Every time I save my changes to my server, it always takes about 30-60 seconds until I can see the changes!每次我将更改保存到我的服务器时,总是需要大约 30-60 秒才能看到更改! (usually have to keep refreshing) (通常要保持刷新)

I do have browser cache disabled, and do refresh with ctrl+refresh.我确实禁用了浏览器缓存,并使用 ctrl+refresh 进行刷新。 I did also check for any kind of file caching, varnish, etc... everything was disabled.我还检查了任何类型的文件缓存、清漆等......一切都被禁用了。

I'm doing heavy development and this is just really annoying when constantly want to see the changes.我正在做大量的开发,当不断想要看到变化时,这真的很烦人。

Using image: bitnami-lampstack-7.4.11-0-linux-debian-10 On virtaulbox.使用图像:bitnami-lampstack-7.4.11-0-linux-debian-10 在 vi​​rtaulbox 上。

If you are developing on top of an AMP Stack or customizing any Bitnami Stack, your files (like JavaScript files) may be cached by the server and even you modify them your changes will not appear to be applied.如果您在 AMP 堆栈上进行开发或自定义任何 Bitnami 堆栈,您的文件(如 JavaScript 文件)可能会被服务器缓存,即使您修改它们,您的更改似乎也不会应用。

In order to disable the cache in the server and let the files be served each time, disable PageSpeed for Apache and OPCache for PHP, enabled by default.为了禁用服务器中的缓存并让文件每次都能提供服务,请禁用 Apache 的 PageSpeed 和 PHP 的 OPCache,默认启用。

To disable PageSpeed, comment out the following lines in your httpd.conf (/opt/bitnami/apache2/conf/httpd.conf)要禁用 PageSpeed,请在 httpd.conf (/opt/bitnami/apache2/conf/httpd.conf) 中注释掉以下几行

#Include conf/pagespeed.conf #Include conf/pagespeed_libraries.conf To disable OPCache, change opcache.enable in your php.ini file and set it to 0 (/opt/bitnami/php/etc/php.ini) #Include conf/pagespeed.conf #Include conf/pagespeed_libraries.conf 要禁用 OPCache,请更改 php.ini 文件中的 opcache.enable 并将其设置为 0 (/opt/bitnami/php/etc/php.ini)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM