Exclude specific IPs from caching?

Whilst Cloudflare caching is great for client sites to make them more reliable and robust, as a developer I do find it time consuming to be constantly having to switch to development mode to disable caching, particularly when I’m working on multiple client sites and having to login to each CF account individually to switch them off.

I was therefore wondering if it was in any way possible to exclude certain IP addresses from even being served cached content? That way i could add my own IP (and possibly some clients too) to an exclusion list so that I can develop away without having to keep switching off development mode.

(It would also bring the benefit of allowing general users to still be served faster, cached content, as it’s really only me as a developer who needs to see the latest versions of files).

My best suggestion would be to add a query parameter like ?v=1 in your browser so that it always uses the newest version of the files.

As for the switching accounts issue, you should probably have a personal CF account set up and then add it as an administrator to all the accounts you have access to. This makes it so the accounts show up in the account switcher, eliminating the need to log into each account individually (unless you need to do billing stuff).

https://support.cloudflare.com/hc/en-us/articles/205065067-How-to-set-up-Multi-User-accounts-on-Cloudflare

2 Likes

Thanks for the advice - is the ?v=1 parameter something which i need to configure or does that work out of the box?

Duly noted about the administrator status, I’ll get that set up too!

The query string you give it is part of the “cache key”, so adding a query parameter (anything, ?v=x is just common) will not match the file without the query parameter, and will instruct Cloudflare to pull that file with that query string from the origin. This is called “cache busting” and can even be used to make sure your clients’ files are always being pulled as the latest version by changing the query string in the script/link HTML tags.

May be you can use your PC host file and point the client domain directly to the hosting server to bypass Cloudflare. The IP you can find if you have access to the cPanel or Cloudflare account. :slight_smile:

Another good suggestion, thanks!

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