Skip to content

Set max age of cache #2509

Open
Open
@bmorelli25

Description

@bmorelli25

Summary

We don't set a max age for cached website assets. This is problematic for certain updates, like #2478, that change the appearance or functionality of the docs. After the update, many users reported a weird half-new/half-old version of the site that could only be fixed with a hard refresh of the page.

One solution would be to use the Cache-Control max age directive. The example below tells the browser that it can use a cached file for one week without having to revalidate it. After one week, the browser will revalidate the file and download a new file if it exists.

Cache-Control: max-age=604800

I'm new to this topic so if I'm wrong, let me know :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions