apache - Apache 的 Varnish 与 memcache/d

标签 apache memcached varnish

我有一个 HTML 网站,运行 Apache 并使用 MySQL 数据库。我想加快 Apache 服务器的响应时间。我想获得关于我应该走哪条路的建议?我在 Google 上读到 Varnish 与 Apache 一起使用。所以我有两个问题:

  1. 我可以将 Memcache 与 Apache 一起使用吗?
  2. 如果是,那么 Memcache 和 Varnish 哪一个更好?

最佳答案

比较 Varnish 和 Memcached 就像比较苹果和橘子。 Varnish 是一个缓存反向 HTTP 代理,它位于 Apache Web 服务器的前面。另一方面,Memcached 是一个分布式对象缓存系统。例如,它可用于缓存从 MySQL 服务器检索的内容。

由于不了解您网站的具体情况,我认为 Varnish 是最简单的方法。理论上,您只需将它扔到您的 Apache 前面即可让您的页面飞起来。当然,现实生活中并非如此。您需要根据您的特定需求调整 Varnish,以有效地处理 cookie、缓存禁止等。

Memcached 需要更改您的代码。您需要仔细检查代码,调查可以从缓存中获得优势的地方,并根据需要实现更改。

Varnish 和 Memcached 都没有提供插件解决方案来加速您的网站,但两者都是帮助您实现该目标的优秀工具。

关于apache - Apache 的 Varnish 与 memcache/d,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10277521/

相关文章:

python - 自定义 flask 应用程序在本地主机上运行良好,但向外部访问者返回 500 响应

Varnish - 在没有 max_connection 的情况下看到 backend_busy

reverse-proxy - Varnish :性能影响大禁止列表

macos - 配置: error: C compiler cannot create executables

redis - "Warning: Memcached::setOption() expects parameter 1 to be integer, string given"使用来自 "Redis Enterprise Cloud"的 Redis Memcached 和 Symfony 5

nginx 位于 haproxy 后面 varnish 后面

json - Logstash apache2 未转换为 json

php - 动态 CSS(带有 php header )无法在 Linux 中呈现(mint)——它在 Windows 中运行良好

java - 我们可以在 BasicNameValuePair 中发送数组吗

memcached - 使用 apache Camel 缓存 http 请求