Rohan Yeole - Homepage Rohan Yeole

How to Update Cache Using JSDelivr Purge?

By Rohan Yeole
Table of Contents

In this guide, I will show you how to properly purge the JSDelivr cache so that your latest files are served instantly.

You hit the purge URL on JSDelivr, refresh your page, and… nothing. Your browser is still serving the old file.

You might be using like e.g

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/yeole-rohan/ray-editor@main/ray-editor.css">
or exact version like
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/yeole-rohan/ray-editor@main/ray-editor.css">
Instead of using cdn.jsdelivr.net, you can trigger a purge by replacing cdn. with purge. in the URL.
<link rel="stylesheet" href="https://purge.jsdelivr.net/gh/yeole-rohan/ray-editor@main/ray-editor.css">
Visiting the purge URL forces JSDelivr to clear its cache and pull the latest version from npm. 


This is especially useful for evergreen UMD builds used in GUIs, since the CDN can take up to 24 hours to update on its own.


Check out: