Is there any delay of sync between CF edges after cache purge api?

I’d like to ask is there any delay of sync between CF edges when we send api to purge cache of individual files? We have js file which may be changed several times a day, we would like to cache this file on CF and purge the cache every time we generate new content for this file. The cache header is set via nginx configuration, like this:

    location  ~* ^/js/config\.js($|\?(\w+)) {
        add_header Cache-Control "s-maxage=86400, max-age=0";
        etag on;

the file name may vary config.js or config.js?yyyymmdd. we use api call to purge this file after a jenkins build, the api cal was success.
However, the file seems partially not really synced, some users see the new file, some see old. Unfortunately this issue happens not really clearly and we unable to get which edge (SIN/HKG/…) the users connected to.

So, is there any delay of sync between CF edges after api call?

In practice yes, although it is usually within a few seconds. But other proxies could be caching your files as well as you cannot flush them, so you cannot guarantee anything.

The only way to make any guarantee that the resources loaded are the ones your HTML expects (or that all resources were built at the same time) is to version your resources within the URL itself.

This topic was automatically closed after 14 days. New replies are no longer allowed.