- def perform(:prefetch, url) do
- Logger.debug("Prefetching #{inspect(url)}")
+ @impl true
+ def history_awareness, do: :auto
+
+ defp prefetch(url) do
+ # Fetching only proxiable resources
+ if MediaProxy.enabled?() and MediaProxy.url_proxiable?(url) do
+ # If preview proxy is enabled, it'll also hit media proxy (so we're caching both requests)
+ prefetch_url = MediaProxy.preview_url(url)
+
+ Logger.debug("Prefetching #{inspect(url)} as #{inspect(prefetch_url)}")