HTTP 中的 'PURGE' 方法是否仅从缓存内存中删除对象?

Does the 'PURGE' method in HTTP only removes the object from cache memory?

我搜索了清除方法,但没有找到任何精确的方法。

A purge is what happens when you pick out an object from the cache and discard it along with its variants. Usually a purge is invoked through HTTP with the method PURGE. An HTTP purge is similar to an HTTP GET request, except that the method is PURGE.

这是我找到的。

没错,您可以发送 PURGE 方法从缓存中删除资源。这是一个说明这一点的例子:

获取 /article/1234 HTTP/1.1

  • 资源尚未缓存
  • 向 API
  • 发送请求
  • 在缓存中存储响应并 return

获取 /article/1234 HTTP/1.1

  • 资源已缓存
  • Return 来自缓存的响应

清除 /article/1234 HTTP/1.1

  • API 向缓存发送 PURGE 方法
  • 资源已从缓存中移除

获取 /article/1234 HTTP/1.1

  • 资源尚未缓存
  • 向 API
  • 发送请求
  • 在缓存中存储响应并 return

如果您展示一些背景信息,它会有所帮助;此方法适用于 Varnish, a caching server.

所以是的,清除缓存条目只会清除缓存条目,底层实体(无论它来自哪里)都不会受到影响。