caching - 如何使 Varnish 不缓存某个文件夹

标签 caching varnish varnish-vcl simplesamlphp

我目前正在尝试为我的网站设置simplesamlphp身份验证,但是在配置过程中,以管理员身份登录时,我一直遇到重定向循环。我得出的结论是,由于无法启动 session ,我认为这是由于缓存的simplesaml文件夹引起的。我正在尝试使其无法缓存服务器上的simplesaml文件夹。我已经在服务器上编辑了default.vcl文件,并进行了以下设置

  # Do not cache these paths.


if (req.url ~ "^/status\.php$" ||
  req.url ~ "^/update\.php" ||
  req.url ~ "^/install\.php" ||
  req.url ~ "^/batch/.*$" ||
  req.url ~ "^/admin" ||
  req.url ~ "^/admin/.*$" ||
  req.url ~ "^/user" ||
  req.url ~ "^/user/.*$" ||
  req.url ~ "^/users/.*$" ||
  req.url ~ "^/info/.*$" ||
  req.url ~ "^/flag/.*$" ||
  req.url ~ "^.*/ajax/.*$" ||
  req.url ~ "^.*/ahah/.*$" ||
  req.url ~ "^/simplesaml/.*$" ||
  req.url ~ "^/saml_login"){
   return (pass);
  }

如您所见,我已经添加了simplesaml文件夹,使其不会被缓存,但是它将无法正常工作。我正在努力寻找我要去哪里。

欢迎任何帮助。谢谢!

最佳答案

VCL是正确的。
可能需要一些时间才能启动,因为它可能是simplesaml文件TTL尚未过期,并且您仍在缓存中。一旦文件被删除并触发对该文件夹的新请求,该内容将不会被缓存。

关于caching - 如何使 Varnish 不缓存某个文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49012502/

相关文章:

php - Magento松节油 Varnish 不能正常工作

varnish4 与 varnish3 - 优雅行为

javascript - 使用 react js 和 webpack 开发的 Web 应用程序的缓存问题

java - 仅查询 Apache Ignite 的缓存以获取本地备份条目

java - 使用临时缓存请求远程 Observable 的 RxJava 模式

apache - Varnish 缓存 : 1 server, 2IP,2 个网站

ruby - 缓存获取的网页有哪些选项?

php - laravel 中用于缓存的 varnish 等效包

Varnish 配置(始终为MISS)

varnish - 调试 VCL 文件的最佳方法是什么?