Skip to content

Make cache control header evaluate at runtime #224

@danielunderwood

Description

@danielunderwood

At

async def add_cache_control_header(response, expiry = provider.utcnow() + timedelta(seconds=app.config['CACHE_TTL']['cloudflare'])):
, the time being passed as a parameter will cause it to be evaluated at the time the function is defined, rather than on each call. The conventional way to do this would be to change the default value to None and generate the value if it is set to None.

Fortunately, it seems that all calls to this function specify the expiry parameter, so it may not be causing any issues.

AB#3869

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