addons-server icon indicating copy to clipboard operation
addons-server copied to clipboard

Set cache headers for unauthenticated views

Open MelissaAutumn opened this issue 8 months ago • 0 comments

We're not setting any cache headers. That's less than ideal.

As a first step, create a middleware to add cache-control with some reasonable age to the response header for unauthenticated requests only.

Probably something along the lines of

if not request.user or not request.user.is_authenticated:
  response.headers['Cache-Control'] = ...

MelissaAutumn avatar May 27 '24 18:05 MelissaAutumn