Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Azure frontend cache invalidator to use the newest Azure SDK #8448

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tm-kn
Copy link
Member

@tm-kn tm-kn commented Apr 28, 2022

  • Make Azure front-end cache invalidator compatible with the newest version of SDK packages.
    • Removes CUSTOM_HEADERS setting as that is no longer supported.
  • This will make it incompatible with the old Azure SDKs. Given we don't enforce versions this may be problematic. I can't see a benefit of maintaining the old version support given how recently this has been added to Wagtail.

PR that originally added the Azure backend: #6119.

Testing locally

You will need Azure CDN and Front Door services provisioned.

Install the SDK libraries.

azure-mgmt-cdn
azure-mgmt-frontdoor

Set up the backend in you settings.

WAGTAILFRONTENDCACHE = {
    'azure_cdn': {
        'BACKEND': 'wagtail.contrib.frontend_cache.backends.AzureCdnBackend',
        'RESOURCE_GROUP_NAME': '',
        'CDN_PROFILE_NAME': '',
        'CDN_ENDPOINT_NAME': '',
    },
    'azure_front_door': {
        'BACKEND': 'wagtail.contrib.frontend_cache.backends.AzureFrontDoorBackend',
        'RESOURCE_GROUP_NAME': '',
        'FRONT_DOOR_NAME': '',
    }
}

Test purging in your ./manage.py shell.

from  wagtail.contrib.frontend_cache.utils import get_backends

fd = get_backends()['azure_front_door']
fd.purge("/test/")

cdn = get_backends()['azure_cdn']
cdn.purge("/test/")

@squash-labs
Copy link

squash-labs bot commented Apr 28, 2022

Manage this branch in Squash

Test this branch here: https://tm-knfeatureupdate-azure-cdn-725xm.squash.io

@lb-
Copy link
Member

lb- commented Aug 10, 2022

Call out for anyone familiar with Azure to review this PR - maybe @chosak @jacobtoppm or @FlipperPA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants