Cache KodikNetworkService#fetchPage

This commit is contained in:
2025-09-14 18:50:49 +05:00
parent 72aafc1d70
commit 059aebddc7
2 changed files with 4 additions and 1 deletions

View File

@ -14,7 +14,8 @@ public class CacheConfig {
"kodikIDPlayerLink", "kodikIDPlayerLink",
"shikimoriIDPlayerLink", "shikimoriIDPlayerLink",
"kinopoiskIDPlayerLink", "kinopoiskIDPlayerLink",
"imdbIDPlayerLink"); "imdbIDPlayerLink",
"kodikPage");
} }
} }

View File

@ -4,6 +4,7 @@ import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.net.URL; import java.net.URL;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.backend.extractor.kodik.service.anyame_backend.api.model.KodikVideoLinks; import com.backend.extractor.kodik.service.anyame_backend.api.model.KodikVideoLinks;
@ -28,6 +29,7 @@ public class KodikNetworkService {
this.objectMapper = objectMapper; this.objectMapper = objectMapper;
} }
@Cacheable("kodikPage")
public String fetchPage(String url) throws IOException { public String fetchPage(String url) throws IOException {
Request request = new Request.Builder() Request request = new Request.Builder()
.url(normalizeUrl(url)) .url(normalizeUrl(url))