Skip to content

Fix contradictory Cache-Control header on documents endpoint #396

@eyeseast

Description

@eyeseast

Touch point: documentcloud/documents/views.py:105-107 and documentcloud/documents/decorators.py:27-43.

DocumentViewSet stacks conditional_cache_control(no_cache=True) on dispatch and anonymous_cache_control on retrieve. The two decorators collide — the no_cache=True from the outer decorator ends up concatenated into the inner decorator's public, max-age=… header.

Action: remove no_cache=True from the retrieve path, or reconcile the two decorators so only one sets Cache-Control per response. The intended behavior is public, max-age=… for anonymous reads and private, no-store for authenticated reads — the existing anonymous_cache_control already branches on that, so the outer decorator is redundant.

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