-1

I have searched for purge method but didn't found anything precise.

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.

This is what I found.

2 Answers2

1

That's correct, you can send the PURGE method to remove a resource from the cache. This is a example to illustrate this:

GET /article/1234 HTTP/1.1

  • The resource is not cached yet
  • Send request to the API
  • Store response in cache and return

GET /article/1234 HTTP/1.1

  • The resource is cached
  • Return response from cache

PURGE /article/1234 HTTP/1.1

  • API sends PURGE method to the cache
  • The resources is removed from the cache

GET /article/1234 HTTP/1.1

  • The resource is not cached yet
  • Send request to the API
  • Store response in cache and return
alapaah
  • 351
  • 2
  • 9
0

It helps if you show some context; this method is for Varnish, a caching server.

So yes, purging a cache entry only purges the cache entry, the underlying entity (wherever it comes from) is untouched.

CodeCaster
  • 147,647
  • 23
  • 218
  • 272