Skip to content

Add Negative Cache TTL for failing requests #509

Description

@mingard

In 3.0.0-RC4 https://github.com/dadi/cdn/pull/360/files the cache.cache404 was added to either enable to disable caching on 404 responses where a fallback asset is not provided.

This is a useful way to limit retries and avoid hanging, or make sure retries are guaranteed, but it's rather binary.

With a long cache TTL of 3600, a 404 will either cache for a full 10 minutes, or with cache404 set to false, potentially flood the request pool.

I propose adding a Negative Cache TTL - a concept used in DNS to tell the receiving service to cache for a shorter time if the record is not available.

cache.cache404 could be extended to be an object with a ttl parameter.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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