Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
It seems like I always get a MISS for - Cloudflare Developers
CD
Cloudflare Developers
•
2y ago
Alek
It seems like I always get a MISS for
It seems like I always get a MISS for the same URL I want to cache
. Is it something I
'm missing
?
"try
{
let url
= await context
.request
.url
;
let paramString
= url
.split
(
'
?
'
)
[1
]
;
if
(paramString
.includes
(
'ntt
=
'
)
|
| paramString
.includes
(
'lpurl
'
)
)
{
const today
= new Date
(
)
;
const tomorrow
= new Date
(today
.getFullYear
(
)
, today
.getMonth
(
)
, today
.getDate
(
)
+ 1
)
;
const seconds
= Math
.floor
(
(tomorrow
.getTime
(
)
+ 18000000
- today
.getTime
(
)
)
/ 1000
)
;
console
.log
(seconds
)
;
let response
= await fetch
(fetchUrl
.concat
(
'
?
'
, paramString
)
,
{
method
:
"GET
"
,
cf
:
{
cacheTtl
: seconds
,
cacheEverything
: true
,
cacheKey
: url
,
}
,
}
)
;
let headersObject
= Object
.fromEntries
(response
.headers
)
;
let responseHeaders
= JSON
.stringify
(headersObject
, null
, 2
)
;
console
.log
(
Response headers: ${responseHeaders}
Response headers: ${responseHeaders}
)
;
return response
;
}
} catch
(err
)
{
return new Response
(
'Error parsing JSON content
'
,
{ status
: 400
}
)
;
}
"
Cloudflare Developers
Join
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,500
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Similar Threads
Was this page helpful?
Yes
No
Recent Announcements
Similar Threads
i figured it out
CD
Cloudflare Developers / functions
3y ago
Thanks for still thinking about it.
CD
Cloudflare Developers / functions
2y ago