Increase cacheTtl to 1 day
This commit is contained in:
parent
aa44d491b4
commit
038f80db03
1 changed files with 2 additions and 2 deletions
|
|
@ -80,7 +80,7 @@ app.head('*', handleGetHead)
|
|||
// handle both GET and HEAD
|
||||
async function handleGetHead(c: Context) {
|
||||
// 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) {
|
||||
return c.json(
|
||||
|
|
@ -104,7 +104,7 @@ async function handleGetHead(c: Context) {
|
|||
|
||||
// delete specific key
|
||||
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) {
|
||||
return c.json(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue