Search code examples
resthttpcachinghttp-verbsacceptverbs

Correct HTTP verb for updating cache for REST Api


I am developing RESTful Api micro service which is cache all data in memory (and update it every n minutes from persistent storage). Service has an api for immediate cache updating /update-cache.

What is best http verb for updating cache?

GET, POST, PUT, PATCH or i need to create some custom verb


Solution

  • What your proposing is not really RESTful, it's more like an RPC-style operation. For this POST is fine.