Skip to content

Commit

Permalink
Merge pull request #3131 from metabrainz/private-cache-response
Browse files Browse the repository at this point in the history
Add Cache_Control private header to server responses
  • Loading branch information
MonkeyDo authored Feb 7, 2025
2 parents f7915ed + 63f2e56 commit 2c00f30
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions listenbrainz/webserver/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,12 @@ def close_connection(exception):
def after_request_callbacks(response):
return inject_x_rate_headers(response)

@app.after_request
def add_cache_header(response):
response.cache_control.private = True
response.cache_control.public = False
return response

# Template utilities
app.jinja_env.add_extension('jinja2.ext.do')
from listenbrainz.webserver import utils
Expand Down

0 comments on commit 2c00f30

Please sign in to comment.