shopware / paas

PaaS template based on production template
MIT License
10 stars 14 forks source link

Remove early returns and prevent caching of objects with no cache-control headers #9

Closed vvuksan closed 1 year ago

vvuksan commented 1 year ago

This pull request has two changes

  1. All early returns from recv.vcl have been changed to set a header called req.http.x-pass. Problem with doing return(pass) is that it skips any backend selection that you may end up doing later in the VCL processing. This is in vast majority of cases undesirable. To really take advantage of this the Paas should add a request setting object that has the action of PASS in case req.http.x-pass is present
  2. Any object with no cache headers should not be cached. It's not necessarily against the spec to cache it however there have been numerous cases of misconfiguration where there was a server misconfig where private data was cached. This is just a safety precaution.
vrobert78 commented 1 year ago

Thanks a lot Vlad for this PR. We already encountered a case where the return(deliver) is preventing the execution of the HTTP compression code, which is placed after the snippet. So we must definitively fix that.

vrobert78 commented 1 year ago

cc @shyim