azureazure-blob-storagecdnhttp-caching

Can you manually set etag and last-modified on Azure blobs?


For redundancy and scale, I'm manually copying blobs to multiple Azure storage accounts globally. These accounts make up multiple 'origins' in an origin-group on the CDN. Thus, when a request comes through from somewhere in the world, it could be served by any of these storage accounts, but the blob contents for the URL should be identical.

Being that they are being manually copied, they'll have different etags and last-modified timestamps. I don't want the caches (on the CDN or client) to "thrash" thinking the content is different each time it hits a different storage account, as the etag/last-modified don't match the version already cached. Ideally I'd like the etag and last-modified properties of the blobs to be identical in each storage account (as the blob contents are).

I can't find anywhere in the REST APIs or Azure .NET APIs where this can be set. I did find an old Java API (https://learn.microsoft.com/en-us/java/api/com.microsoft.azure.storage.blob.blobproperties.setetag) so it would appear it is or was settable at some point.

Anyone know if this is doable via any API or endpoint? Or am I going about this the wrong way?


Solution

  • Can you manually set etag and last-modified on Azure blobs?

    Simple answer is that you cannot. Both etag and last-modified date on Azure blobs are system-defined properties and are set by Storage service anytime a blob is modified.