Stackpath logo

StackPath has announced about CDN product retirement

StackPath is dedicating its entire focus to being the industry’s best cloud computing platform built at the internet’s edge. Subsequently, we are retiring the StackPath Content Delivery Network (SP// CDN) offering.

New SP// CDN subscriptions are no longer available, and SP// CDN and its add-on services/features will cease operations at 12:00 a.m. Central (UTC-6:00) on November 22, 2023.

This is why the module is unsupported anymore and is obsolete.

Project description will still be left here.

The stackpath module integrates Stackpath CDN with Drupal for purging content.

This module does the following:

  1. Sets the X-Tag http header required by StackPath for tag based Purging in Drupal 8. No configuration is required for this.
  2. Offers a purger plugin for invalidating via tag at StackPath (see below).
  3. Recommended modules:
    • purge_queuer_coretags (provides the queueing of the invalidations made by Drupal core)
    • purge_processor_cron (actual processor of the queue)
    • purge_drush (all above in one but with drush)

To enable purging, browse to admin/config/development/performance/purge and
add the purger provided by this module.

To configure the purger, you need a StackPath stack id, client id and secret for authentication.

The stack id can be retrieved from the URL: https://control.stackpath.com/stacks/this-is-your-stack-id

Client id and secret are retrieved in the control panel at Stackpath.
Generate client id and secret

At the moment purging with cron is supported. In order to frequently purge queued items configure the frequency cron is running on your website.

To configure a purger go to /admin/config/development/performance/purge and setup the purger for Stackpath.
Create purger for Stackpath

The cache can be purged by running cron like this:

drush --uri=URL_OF_WEBSITE cron

To check if your setup works pay attention to the response headers, that are send by the Stackpath. The X-HW header has the information, if the page was served from cache. The suffix .c stands for cache. More about this header can be read here.

Example

...
x-generator: Drupal 8 (https://www.drupal.org)
x-hw: 1567698402.cds143.fr8.hn,1567698402.cds013.fr8.c
...

After purging you see the updated page, and after the third request you see a header similar to the one shown above.

Supporting organizations: 
Sponsored development

Project information

Releases