Report this

What is the reason for this report?

Cloudflare cache invalidation on App Platform

Posted on December 22, 2020

Are cache tags supported (and their invalidation) with App Platform and the Cloudflare CDN? I’d like to make sure my requests have proper Cache-Tag headers. The problem is that invalidation with Cloudflare is an API based process.

If the Cache-Tags header isn’t available, what is a good way to handle cached responses on App Platform without setting a low Cache-Control header.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

👋🏼 @nmd.matt

App Platform doesn’t support Cache-Tag headers at this time, however, you can make use of Cache-Control headers per Cloudflare’s guidelines: https://support.cloudflare.com/hc/en-us/articles/115003206852-Understanding-Origin-Cache-Control

For Static Site components, we set a Cache-Control header automatically and explicitly purge the CDN cache on each app deployment. I hope that helps!

Is there a way to increase max-age? 10 seconds for hashed JS file names seems way too low. Perhaps for .html extensions it makes sense but for CSS/JS etc. it would make sense to have a higher number if the asset names are hashed.

Hi there,

Quick update here in case that it helps, App Platform edge controls are now generally available, giving you more control over your app’s CDN and security behavior. The new features include email obfuscation, enhanced threat control to help mitigate layer 7 DDoS attacks, and CDN cache controls for fine-tuning content delivery.

You can find full configuration details here: https://docs.digitalocean.com/products/app-platform/how-to/configure-edge-settings/

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.