Caching
You can set the caching policy of your frames by defining the Cache-Control
headers of your frame's image response
frames/route.tsx
// ...
const handleRequest = frames(async (ctx) => {
return {
image: "/images/my-image",
imageOptions: {
// Tell the client how long to cache the image for using the Cache-Control header
headers: {
"Cache-Control": "public, max-age=0",
},
},
// ...
};
});
See an example of how to use the Cache-Control
header in the Caching example.