Increase cacheTtl to 1 day

This commit is contained in:
Erisa A 2023-03-23 23:30:40 +00:00
parent aa44d491b4
commit 038f80db03
No known key found for this signature in database

View file

@ -80,7 +80,7 @@ app.head('*', handleGetHead)
// handle both GET and HEAD // handle both GET and HEAD
async function handleGetHead(c: Context) { async function handleGetHead(c: Context) {
// actual logic goes here // actual logic goes here
const urlResult = await c.env.KV.get(c.get('key')) const urlResult = await c.env.KV.get(c.get('key'), { cacheTtl: 86400 })
if (urlResult == null) { if (urlResult == null) {
return c.json( return c.json(
@ -104,7 +104,7 @@ async function handleGetHead(c: Context) {
// delete specific key // delete specific key
app.delete('*', async (c) => { app.delete('*', async (c) => {
const urlResult = await c.env.KV.get(c.get('key')) const urlResult = await c.env.KV.get(c.get('key'), { cacheTtl: 86400 })
if (urlResult == null) { if (urlResult == null) {
return c.json( return c.json(