• Welcome to the Chevereto User Community!

    Here, users from all over the world come together to learn, share, and collaborate on everything related to Chevereto. It's a place to exchange ideas, ask questions, and help improve the software.

    Please keep in mind:

    • This community is user-driven. Always be polite and respectful to others.
    • Support development by purchasing a Chevereto license, which also gives you priority support.
    • Go further by joining the Community Subscription for even faster response times and to help sustain this space
  • Chevereto Support CLST

    Support response

    Support checklist

    • Got a Something went wrong message? Read this guide and provide the actual error. Do not skip this.
    • Confirm that the server meets the System Requirements
    • Check for any available Hotfix - your issue could be already reported/fixed
    • Read documentation - It will be required to Debug and understand Errors for a faster support response

Purge CDNSun when a file is deleted on the VPS (w/ inotify)

Mortgage

Chevereto Member
I was inspired by @koxle's "Try to purge cache for Cloudflare when image was deleted"

Purge CDNSun when a file is deleted on the VPS (w/ inotify).

apt update
apt install -y inotify-tools jq

Create the purge script https://pastebin.com/DSjPQYfY

Create a systemd service to watch deletes https://pastebin.com/4BhxE6XW

Verify it exists and is executable:
ls -l /usr/local/bin/cdnsun-purge.sh
-rwx------ 1 root root ... /usr/local/bin/cdnsun-purge.sh

sudo systemctl daemon-reload
sudo systemctl enable --now cdnsun-purge.service

Delete a test file:
rm /srv/storage/uploads/2025/11/10/IMG_94564.jpeg

Within a second or two the service will POST to:
https://cdnsun.com/api/cdns/<<PUT_YOUR_SERVICE_ID_HERE>>/purge
with:
Code:
{"purge_paths":["/2025/11/10/IMG_94564.jpeg",
                "/2025/11/10/IMG_94564.md.jpeg",
                "/2025/11/10/IMG_94564.th.jpeg"]}

Check watcher logs:
journalctl -u cdnsun-purge -n 50 --no-pager -l
You should see a “Purging … via CDNSun” line for the original plus .md and .th.

Confirm via:
curl -I https://<<CDN_DOMAIN>>/2025/11/10/IMG_94564.jpeg

This approach doesn’t touch Chevereto at all. It reacts to actual filesystem deletes (which Chevereto performs over SFTP) and purges the matching CDN objects immediately.
 
Last edited:
Back
Top