我想将生成的php脚本输出保存到apache首先检查的文件夹结构中。
/about/index.php <- dynamic should be rendered only if cache below does not exist /contact/index.php /public/about/index.html <- cached should be rendered first if exists /public/contact/index.html
我如何创build一个RedirectCond / RedirectRule集为我做这个?
让网站指向caching目录。 设置一个规则,如果文件不存在,则重写到“dynamic”源目录。 dynamic脚本也必须负责写入caching目录(假设你想caching)。 还有其他的东西会负责删除caching(cron作业等)的陈旧条目。
更好的办法是将一个实际的caching逆向代理放在Apache前面。 可以使用Apache作为反向代理,但有更好和更合适的工具,如nginx或varnish。