Apache的文件缓存

编程入门 行业动态 更新时间:2024-10-22 10:48:27
本文介绍了Apache的文件缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

如何某些文件的阿帕奇处理缓存,并且是可以明确地说,某些文件应积极缓存比别人多,通过标准的配置文件给定主机或虚拟主机?

要把它放在上下文中,我把大量的网站内容在不同的XML文件,我想能够说,这个文件将被用到了很多,因此它缓存尽可能.. ?是否阿帕奇做这种事情智能化和动态..?它会观察哪些文件是比其他人更受欢迎,尝试匹配缓存命中适当..?

很多的一个问题,但基本的思路应该是足够清晰。

编辑:要清楚,这是加载和跨$ P $由PHP PTED这些资源文件 - 但PHP作为一个进程内阿帕奇催生..对不对?请帮助!

解决方案
  • Apache是​​的只是 web服务器。它不知道具体的应用程序,所以它是你的应用程序的缓存结果的责任。
  • 您可以使用应用程序不了解模块阿帕奇 - mod_cache的。另外,请参阅例如在文章缓存动态内容的配置与Apache httpd的 。这个模块允许你指定什么应该被缓存,什么不应该被缓存。
  • 此外,您还可以使用一些特定的PHP缓存机制,例如替代PHP缓存或的memcached 。
  • How does apache handle caching of certain files, and is it possible to explicitly say that certain files should be aggressively cached more than others, through the standard config files for a given host or virtualhost?

    To put it in context, I keep a lot of site content in various XML files, and I'd like to be able to say that this file will be used a lot, and therefore cache it as much as possible..? Does apache do this kind of thing intelligently and on the fly..? Will it observe which files are more popular than others and try to match cache hits appropriately..?

    Lots of questions in one, but the basic idea should be clear enough.

    edit: to be clear, these are resource files which are loaded and interpreted by PHP - but php as a process is spawned inside apache.. right? Please help!

    解决方案

  • Apache is just a web-server. It doesn't know specific of your application, so it is responsibility of your application to cache results.
  • You can use application unaware module in apache - mod_cache. Also, see example of configuration in article Caching Dynamic Content with Apache httpd. This module allows you to specify what should be cached and what shouldn't be cached.
  • Also, you can use some PHP-specific caching mechanism, e.g. Alternative PHP Cache or memcached.
  • 更多推荐

    Apache的文件缓存

    本文发布于:2023-11-01 01:30:12,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1547852.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:缓存   文件   Apache

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!