aboutsummaryrefslogtreecommitdiff
path: root/src/app/kdrama/components/cacher.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/kdrama/components/cacher.js')
-rw-r--r--src/app/kdrama/components/cacher.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/app/kdrama/components/cacher.js b/src/app/kdrama/components/cacher.js
new file mode 100644
index 0000000..3ef05be
--- /dev/null
+++ b/src/app/kdrama/components/cacher.js
@@ -0,0 +1,8 @@
+// This file pre fetches all the videolinks and next js automatically caches them!
+
+export default async function VideoLinkCacher(data, dramaId) {
+ data.forEach(async (element) => {
+ const link = `https://consumet-api-di2e.onrender.com/movies/dramacool/watch?episodeId=${element.id}&mediaId=${dramaId}`;
+ await fetch(link, { cache: "force-cache" });
+ });
+}