How can I make a response cachable by browsers?
FinishResponseSubscriber overwrites the ETag header, unless your response meets certain conditions. That is it has to be cacheable and provides a custom Cache-Control header. When testing the code make sure you have browser caching enabled (in the performance settings).

Example:

  public function view() {
    $response = new CacheableResponse();
    $response-&gt;headers-&gt;set('Cache-Control', 'public, max-age=60');
    $response-&gt;setEtag('123'); 
    return $response;
  }


Besides browser caching you might also want to set Drupal caching data to invalidate the cached response when the content becomes outdated, see for example Invalidate cache on a REST endpoint.