Skip to content

Drop Vary: Cookie from anonymous responses #397

@eyeseast

Description

@eyeseast

Touch point: documentcloud/documents/decorators.py:27-43.

anonymous_cache_control wraps with vary_on_cookie. Every cookie variation (analytics _ga, Cloudflare's __cf_bm, etc.) fragments the
CDN cache. For anonymous public-document responses, the cookie value doesn't pivot the response — drop the Vary: Cookie and/or replace it with Vary: Authorization.

If vary_on_cookie is needed for the authenticated branch, gate it behind the request.user.is_authenticated check rather than applying it unconditionally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions