使用 apache mod_expires 缓存 php,php 文件的 mime 类型是什么?

Use apache mod_expires to cache php, what is a mime type for php files?

我想在 mod_expires 中缓存 php 几秒钟,我找不到示例,没人想缓存它(我知道,我知道)。

我应该在 ExpiresByType 中放入什么来缓存 php?

Debian 使用 text/x-phphttps://packages.debian.org/sid/mime-support

IANA 建议 text/x-phpapplication/x-phphttps://www.ietf.org/rfc/rfc4329.txt

请注意,text/phpapplication/php 可能不起作用。

What should I put into ExpiresByType to cache php?

无论 Content-Type 您的 PHP 脚本生成什么。例如,text/html 如果他们正在生成 HTML 个页面。

更好的选择通常是在 PHP 代码中生成 Expires headers。