Trigger delete cache of url I've two api url


/api/v1/get-list
/api/v1/post-item


In API url /api/v1/get-list I was set cache like this:

$build = [
  '#cache' =&gt; [
    'contexts' =&gt; ['url','url.query_args'],
    'max-age' =&gt; 3600,
  ],
];

$res = new ResourceResponse($response, 200);
$cache_metadata = CacheableMetadata::createFromRenderArray($build);
$res-&gt;addCacheableDependency($cache_metadata);


Response will be cache in one hour with url /api/v1/get-list?_format=josn. When I use api /api/v1/post-item response of /api/v1/get-list will changed value. But response was cached in one hour. So how to trigger delete cache of url when use orther url. I find some code 

\Drupal::service('page_cache_kill_switch')-&gt;trigger(); 


but just for current request.
Add a cache tag to the response of /api/v1/get-list:

$build = [
  '#cache' =&gt; [
    'contexts' =&gt; ['url','url.query_args'],
    'max-age' =&gt; 3600,
    'tags' =&gt; ['api-v1-list'],
  ],
];


and then invalidate this tag in /api/v1/post-item:

\Drupal\Core\Cache\Cache::invalidateTags(['api-v1-list']);