Skip to content

cache 404s and purge cache on upload #769

@arianvp

Description

@arianvp

Is your feature request related to a problem? Please describe.

We are currently not caching 404s. So they are quite slow as they need to reach out to us-east-1 S3 bucket.

Maybe this is by accident as the VCL code does have sections named cache-is-404

However if we want to cache 404s we need to be able to purge them on channel bumps.

Describe the solution you'd like

We can create an S3 Event Notification that triggers a Lambda every time an object is PUT into the bucket. The lambda then simply does a curl -XPURGE https://cache.nixos.org/<key>

Describe alternatives you've considered

Have some script in Hydra do this

Additional context

We do around 12 million PUTs per month to S3
Lambda costs $0.20 per million requests. So this would cost $2.40 per month

https://aws.amazon.com/lambda/pricing/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions