CDN cache for local and staging environment

Is there any way to utilize the cache for localhost/staging environment? Right now we don’t have any images on localhost, the amount of media is too large to keep locally. Is there a way to check the CDN cache first when retrieving those images on localhost?

Maybe the best solution is for localhost/staging we reference the absolute path instead of the relative path?

I hope I explained it correctly. And in case anyone asks, we are Enterprise.

As Cloudflare just routes cacheable resources through standard hostnames, you’d have to configure your local staging site to reference a :orange: Proxied hostname as the absolute path you suggested.

1 Like

The way I got around this was to create a path variable in my code for images, another for CSS, another for scripts and so on, using these instead of hardcoded relative or absolute paths.

This also means that when creating features that use resources those need to be deployed into the CDN to be useable - and hopefully not interfere with existing resources.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.