diff --git a/app/api/$$.mjs b/app/api/$$.mjs new file mode 100644 index 0000000..25da16d --- /dev/null +++ b/app/api/$$.mjs @@ -0,0 +1,9 @@ +import cacheControl from '../lib/cache-control.mjs' + +export async function get() { + return { + headers: { + 'cache-control': cacheControl, + }, + } +} diff --git a/app/api/photographs/blackwhite.mjs b/app/api/photographs/blackwhite.mjs index 6534512..dc951e2 100644 --- a/app/api/photographs/blackwhite.mjs +++ b/app/api/photographs/blackwhite.mjs @@ -1,5 +1,10 @@ +import cacheControl from '../../lib/cache-control.mjs' + export async function get() { return { + headers: { + 'cache-control': cacheControl, + }, json: { artworks: [ { diff --git a/app/api/photographs/heir.mjs b/app/api/photographs/heir.mjs index 792cc85..8e6ad8d 100644 --- a/app/api/photographs/heir.mjs +++ b/app/api/photographs/heir.mjs @@ -1,5 +1,10 @@ +import cacheControl from '../../lib/cache-control.mjs' + export async function get() { return { + headers: { + 'cache-control': cacheControl, + }, json: { artworks: [ { diff --git a/app/api/photographs/images-pour-rien.mjs b/app/api/photographs/images-pour-rien.mjs index d2a2599..a68ebc0 100644 --- a/app/api/photographs/images-pour-rien.mjs +++ b/app/api/photographs/images-pour-rien.mjs @@ -1,5 +1,10 @@ +import cacheControl from '../../lib/cache-control.mjs' + export async function get() { return { + headers: { + 'cache-control': cacheControl, + }, json: { artworks: [ { diff --git a/app/api/photographs/locus.mjs b/app/api/photographs/locus.mjs index 84941f2..117aeca 100644 --- a/app/api/photographs/locus.mjs +++ b/app/api/photographs/locus.mjs @@ -1,5 +1,10 @@ +import cacheControl from '../../lib/cache-control.mjs' + export async function get() { return { + headers: { + 'cache-control': cacheControl, + }, json: { artworks: [ { diff --git a/app/api/photographs/northern-italy.mjs b/app/api/photographs/northern-italy.mjs index 69c3226..1088928 100644 --- a/app/api/photographs/northern-italy.mjs +++ b/app/api/photographs/northern-italy.mjs @@ -1,5 +1,10 @@ +import cacheControl from '../../lib/cache-control.mjs' + export async function get() { return { + headers: { + 'cache-control': cacheControl, + }, json: { artworks: [ { diff --git a/app/api/photographs/protest.mjs b/app/api/photographs/protest.mjs index 52bfc9c..618a6be 100644 --- a/app/api/photographs/protest.mjs +++ b/app/api/photographs/protest.mjs @@ -1,5 +1,10 @@ +import cacheControl from '../../lib/cache-control.mjs' + export async function get() { return { + headers: { + 'cache-control': cacheControl, + }, json: { artworks: [ { diff --git a/app/lib/cache-control.mjs b/app/lib/cache-control.mjs new file mode 100644 index 0000000..7dcdc1b --- /dev/null +++ b/app/lib/cache-control.mjs @@ -0,0 +1,5 @@ +const cacheControl = process.env.ARC_ENV === 'production' + ? 'max-age=1800;' + : 'no-cache, no-store, must-revalidate, max-age=0, s-maxage=0' + +export default cacheControl