This section provides steps on how to configure and verify your edge caching.
Global CDN is automatically present on each Pantheon site. You do not need to install or activate it. However, you should review the content on this page if you are interested in configuring how Global CDN will cache your site.
Global CDN does not require a module or plugin installation. Do not install the Drupal Varnish or CDN modules.
We recommend installing the Pantheon Advanced Page Cache to take advantage of Global CDN's granular cache clearing capabilities.
Additionally, you can remove all pages from cache in the Site Dashboard under Site Admin or from the command line.
Refer to Clearing Caches for Drupal and WordPress for more information.
You do not need to separately configure your HTTP headers for Global CDN.
Global CDN respects standard HTTP headers served by your site. If you set pages to expire in 5 minutes, Global CDN will expire the content as requested. If your site sends headers that forbid caching, Global CDN won't cache the content.
Review detailed instructions on how to configure and optimize caching:
The most common issue with effectively using edge and CDN caching is troubleshooting situations where the cache should hit but doesn't. Review the content below for common mistakes that cause cache misses.
Follow the steps below if you have checked your HTTP headers and found that caching is not working:
Go back and check the HTTP headers to verify that caching is working correctly after your configuration changes.
Follow the steps below if you are still receiving
no-cache, must-revalidate, post-check=0, pre-check=0 as a response:
Verify that messages are set. The drupal_set_message function disables page caching.
Verify that messages are present in page templates. Themes can sometimes remove messages to suppress user-facing messages.
You can manually flush the cache if you are experiencing issues with theme images not refreshing:
Navigate to your Pantheon Dashboard and then click the Clear Caches button.
Refresh the page and confirm that the images are loading correctly.
Follow the steps below to make sure there are no other errors within Drupal that may be preventing images from being cached.
drupal_set_message()calls are being sent to the page.
Verify that the
drupal_set_message()errors are not being suppressed in the theme if you are doing theme development.
Your Views cache might be persisting if you have cleared caches using the Pantheon Dashboard and still see stale views on your Drupal-powered site. Follow the steps below for the views that need to be dynamic.
Verify that Views have caching enabled.
Disable some caching using caution. Disabling other caching can help improve Views caching.
To test whether or not a cookie is preventing the CDN from caching:
Run curl command:
curl -I dev.mysite.com HTTP/1.1 301 Moved Permanently cache-control: public, max-age=300 Age: 23 Vary: Cookie, Cookie
Examine the headers output (Age, Max-Age, Cookie).
- You will notice a
max-age of 300, and if you run the command again, the
Agefield will continue to increase until it reaches the TTL set by the max-age.
- You will notice a
Check if a cookie is being set (with the Set-Cookie header) if you see
Age:0in your output after more than one request (see the example output below). Setting cookies will prevent the CDN from caching that page.
curl -I dev.mysite.com
HTTP/1.1 200 OK
cache-control: public, max-age=900
Vary: Accept-Encoding, Cookie
In the event that a cookie is set and you are unsure of what's setting it, disable modules one-by-one and test for the cookie via 'curl' command after each one is disabled. When the cookie is no longer set, the last module disabled before the test is causing the issue.