Skip to content

Commit

Permalink
clean up asset endpoint (#2289)
Browse files Browse the repository at this point in the history
  • Loading branch information
srliao authored Dec 5, 2024
1 parent 68f0407 commit 82415ef
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions ui/packages/workers/src/assets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ export async function handleAssets(
`Response for request url: ${request.url} not present in cache. Fetching and caching request.`,
);

const x = new URL(request.url);
const resp = await fetch(
new Request(ASSETS_ENDPOINT + x.pathname + x.search),
{
cf: {
cacheTtl: 60 * 24 * 60 * 60,
cacheEverything: true,
},
const resp = await fetch(new Request(ASSETS_ENDPOINT + cacheUrl.pathname), {
cf: {
cacheTtl: 60 * 24 * 60 * 60,
cacheEverything: true,
},
);
});

response = new Response(resp.body, resp);
response.headers.set('Cache-Control', 'max-age=5184000');
Expand Down

0 comments on commit 82415ef

Please sign in to comment.