Skip to content

A Netlify plugin for persisting immutable build assets across releases.

Notifications You must be signed in to change notification settings

andyrichardson/netlify-plugin-ttl-cache

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Netlify plugin TTL cache

A Netlify plugin for persisting immutable build assets across releases.

How it works

By default, Netlify replaces all existing static assets when publishing new releases.

For sites where assets are unique across deployments, and dynamically loaded (e.g. React.lazy) this can lead to runtime errors (e.g. chunk-load errors).

This plugin prevents this problem by allowing users to include legacy assets across releases.

Usage

Install the plugin

npm i -D netlify-plugin-ttl-cache

Add the plugin to your netlify.toml

[[plugins]]
package = "netlify-plugin-ttl-cache"
  [plugins.inputs]
  path = "build"
  ttl = 90

Inputs

path

Build output directory.

type: string

default: "build"

ttl

Maximum age (days) of files in cache.

type: number

default: 90

exclude

Regular expression string pattern for files to exclude.

type: string

default: n/a

About

A Netlify plugin for persisting immutable build assets across releases.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published