Configuring Varnish to rewrite Expires/Cache-Control headers for client-side caching

Solution 1:

This does the trick:

sub vcl_fetch {
  ..
  if (req.url ~ "\.css$") {
    set obj.http.magicmarker = "1";
  }
  ..
}

sub vcl_deliver {
  ..
  if (resp.http.magicmarker) {
    unset resp.http.magicmarker;
    set resp.http.Cache-Control = "...";
    set resp.http.Expires = "...";
    set resp.http.Age = "...";
  }
  ..
}