gpt4 book ai didi

apache2 - Vagrant/VirtualBox/Apache2 奇怪的缓存行为

转载 作者:行者123 更新时间:2023-12-02 05:55:28 25 4
gpt4 key购买 nike

我正在使用 Vagrant 来运行 Ubuntu 驱动的 VirtualBox 和 Apache2。

网络服务器等提供我的/vagrant 目录中的静态文件。

这在大多数情况下都很有效。但是,当我更改共享文件夹上的图像并重新加载网站时,会提供图像的先前版本,但它会被截断。

如果我先从共享文件夹中删除旧图片,刷新网站以便不显示图片,然后保存新文件并再次重新加载网站,则可以。

有人知道这个问题吗?我没有安装任何特殊的东西,只是带有 mod_rewrite 的 Apache 2 和带有 Mongo 的 PHP、APC 插件、MongoDB 以及带有一堆脚本的 NodeJS。

最佳答案

找到答案here :

JC,

What you're seeing is probably because the server serving the static files is using the "sendfile()" syscall, which is broken with the VirtualBox file system. You need to disable sendfile() usage in your server. For Apache:

EnableSendfile off

And for nginx: sendfile off;

Best, Mitchell

关于apache2 - Vagrant/VirtualBox/Apache2 奇怪的缓存行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9479117/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com