Skip to content

[Cache] purging #501

@krizhanovsky

Description

@krizhanovsky

Manual cache purging must be implemented. An example of the purging is

    $ curl -X PURGE <URL>

which sends

    PURGE / HTTP/1.1\r\n
    User-Agent: curl/7.40.0\r\n
    Host: <host>\r\n
    Accept: */*\r\n
    \r\n

Following new configuration options must be introduced:

  • cache_purge - cache purging mode, binary variable for first implementation, but can be extended in future (e.g. setting eviction strategy and speed for purged entries). "invalidate" value (default and the first implemented) means that purged entries are just invalidated and still can be returned to a client under certain conditions (Servicing stale cached responses and immediate purging #522, note that for 0.5 we never return stale responses, so this is just fake purging). "purge" means real purging backed by TDB deletion operator (this mode depends on TDBv0.3: transactions, indexes, durability #516).
  • cache_purge_acl - control who can purge the cache by list of IP addresses or netmasks.

See Nginx, Varnish and Squid implementations as reference examples.

Wildcard purging is not necessary at this time.

Use case. If some content is changed at upstream server, then PURGE request followed by GET request will update appropriate entry in the cache.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions