Azure Maps API ignoring 'If-None-Match' header?

Wiesmüller, Benjamin 1 Reputation point
2020-08-18T11:52:45.61+00:00

Hello,

I am using the https://atlas.microsoft.com/map/tile?api-version=2.0 endpoint to get map tiles via a Node.js server (acting as a proxy to prevent exposing the subscription key on a website).

I noticed the Azure Maps API returns an ETag in the response header.

I tested caching by requesting a tile with Header "If-None-Match" set to the ETag returned by a request sent immediately beforehand.
I noticed the server still responds with HTTP status 200 instead of the expected 304 (Not Modified).

Does the server support the "If-None-Match" header?
Is there something wrong with my HTTP request?

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
736 questions
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 18,686 Reputation points Microsoft Employee
    2020-08-18T15:52:23.55+00:00

    I'm not sure about your questions but a couple of things to be aware of:

    • Server side caching as a way to reduce calls and serve multiple users is against the terms of use.
    • Instead of trying to hide a subscription key, consider using Azure Active Directory with Azure Maps. It provides a lot more security and specifically added to Azure Maps for this reason. Here are a bunch of code samples and resources on this:

    https://learn.microsoft.com/en-us/azure/azure-maps/how-to-manage-authentication

    https://github.com/Azure-Samples/Azure-Maps-AzureAD-Samples


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.