Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Revisions

Add a new revision

  • Select the Star Wars API v2.
  • Select the Revisions tab.
  • Add a new revision with description Adding a caching policy.

    APIM Revisions Menu APIM Revision Create

    The new revision is online but not yet current. The previous revision continues to remain the active default. Having added the new revision has not resulted in any change for your API consumers.

    APIM Created Revision

Add caching

  • Switch to the Design tab, then select the Get People operation.

    Revision 2 automatically became the active revision you are now making changes in. You can also switch between revisions, but be aware that changes to the Current revision are live immediately.

    APIM Revision Add Caching

  • Add a 10-second caching policy for the GET operation via the Code editor.

    <inbound>
        <base />
        <cache-lookup vary-by-developer="false" vary-by-developer-groups="false" allow-private-response-caching="false" must-revalidate="false" downstream-caching-type="none" />
    </inbound>
    <backend>
        <base />
    </backend>
    <outbound>
        <base />
        <cache-store duration="10" />
    </outbound>
    

    APIM Revision Add Caching

Test the new revision

  • From the Azure portal, test the Get People operation.

    Note the revision number at the top of the page as well as in the request URL.
    The request URL should look similar to: https://<your-apim-name>.azure-api.net/sw/v2;rev=2/people/.

    APIM Revision Caching Test

  • Test the API twice. The test trace should then show that the cache-lookup occurred.

    APIM Revision Caching Test

Make current revision

  • Select the Revisions tab.
  • Click on the ellipsis for rev2 and make it the current revision.

    APIM Revision Make Current

  • Choose to post to the public change log for the API and provide a meaningful update.

    APIM Revision Make Current

  • The new revision is now the current/live one. When you test now, note that the URL no longer contains a specific revision. The old revision is still online and can now be accessed with the rev qualifier.

    Unlike versioning, revisioning requires no URL updates for the API consumer.

    APIM Revision Make Current