Question

I'm using an Azure CDN endpoint on a hosted service (meaning, not a Blob Storage CDN endpoint).

The service is lazy rendering images, and once they are rendered, they are practically static (I can safely use Cache-Control:public, max-age=31536000).

In the naive implementation, there will be up to** X misses (X times the service will render an image) - Where X is the number of CDN nodes around the world.

There are two workarounds, as I see it:

  1. The lazy created images are stored in Blob Storage, and later pulled from there.
  2. Implement a cache in the Cloud Service.

Is there a way to propagate files to all nodes? Is there a better solution then having two caching layers (Cloud Service Cache / Blob Storage + CDN)?

** "Up to", depending on the geographical location of web requests. In my case, all around the world.

Was it helpful?

Solution

There is currently not a way for you to push something to one of the remote CDN nodes. This is a feature that many folks have asked Microsoft for in the CDN product.

Both workarounds would work. The first one benefits from not having to recreate them for the other CDN notes at all and will reduce the load on the server since it wouldn't be feeding these up after it renders them the first time. However, if it turns into you needing to get the request at the server anyway and then redirect to a version already in BLOB storage then you could easily just return the cached image as well. I think it depends on how many images you are talking about. If you have a LOT of them I'd lean more toward the first option.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top