HTTP中的"PURGE"方法是否仅从高速缓存中删除对象? [英] Does the 'PURGE' method in HTTP only removes the object from cache memory?
问题描述
我已经搜索了清除方法,但没有发现任何精确的方法.
I have searched for purge method but didn't found anything precise.
清除是当您从缓存中选择一个对象并连同它的变体一起丢弃它.通常通过以下方式调用清除使用方法PURGE的HTTP.HTTP清除类似于HTTP GET请求,除了方法是PURGE.
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方法从缓存中删除资源.这是一个说明这一点的示例:
That's correct, you can send the PURGE method to remove a resource from the cache. This is a example to illustrate this:
获取/article/1234 HTTP/1.1
GET /article/1234 HTTP/1.1
- 该资源尚未缓存
- 发送请求到API
- 将响应存储在缓存中并返回
获取/article/1234 HTTP/1.1
GET /article/1234 HTTP/1.1
- 资源已缓存
- 从缓存返回响应
清除/article/1234 HTTP/1.1
PURGE /article/1234 HTTP/1.1
- API将PURGE方法发送到缓存
- 资源已从缓存中删除
获取/article/1234 HTTP/1.1
GET /article/1234 HTTP/1.1
- 该资源尚未缓存
- 发送请求到API
- 将响应存储在缓存中并返回
这篇关于HTTP中的"PURGE"方法是否仅从高速缓存中删除对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!