Skip to content

Commit

Permalink
added 24Hr cache for loading url
Browse files Browse the repository at this point in the history
  • Loading branch information
anubhavitis committed Feb 4, 2024
1 parent 033e337 commit df62494
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/api/utils/fetch-site.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CheerioAPI, load } from 'cheerio';

export const fetchSite = async (url: string): Promise<CheerioAPI> => {
const response = await fetch(url);
const response = await fetch(url, { next: { revalidate: 86400 } });
const body = await response.text();

return load(body);
Expand Down

0 comments on commit df62494

Please sign in to comment.