How can I avoid cloudflare caching my user backoffice


#1

I find it very strange Cloudflare is caching our users back-office that by the was is password protected

Our users are uploading photos and they should NOT be cached as it will cause problems if a user or admin changes the photo, as it will not be changed as it is cached

So how to avoid Cloudflare caching back-office or password protected pages of our website


#2

Well, if you place it behind Cloudflare it naturally will cache it. Solution, remove it from Cloudflare.


#3

Didn’t expect it had access to our password-protected part of the website, will try to find out how to remove it.

For now, Cloudflare as only been a problem us, so not happy at all.

Will give it a try but I think in the end we will just remove Cloudflare as it does more bad than good.


#4

Why should it skip that?

Not sure what your problems were, but maybe it is the better choice not to use it. For me its working pretty well. Your issue should not be too difficult to fix either, most probably with a page rule.


#5

I will give it one last try, and see how it goes.


#6

Okay now I tried the pages rules setting with: Cache Level = Bypass

Did not work either, so if Cloudflare Support cant come up with a solution, then is bye bye Cloudflare


#7

I presume you are on paid plan.


#8

YES, the professional plan :slight_smile:


#9

In that case support should really find a solution :slight_smile: Have you contacted them already?

Have you purged the cache items in questions?


#10

I have now paused the Cloudflare and my website is again working perfectly as it should, happy days.

So waiting for Cloudflare support to answer me before I am going to active Cloudflare again or permanently delete it if no solution is available


#11

CF does not have back end access. Simply, all web files run through it. If you are logged into your back end, that traffic is still getting optimized/cached by CF before reaching you.
You should use a page rule to exclude certain directories from being cached. Then, any changes are live - such as an updated avatar.


#12

Did not work with pages rules but I have now excluded user profile image from the browser cache on my server and that solved the problem :slight_smile:


#13

Can you give a little more information on how you did that?


#14

That would be too complicated for me to explain as I am not a developer and just asked my developers to do it, but I am sure if you ask your developers they would know how to do it as well. I believe some PHP coding was done to solve it. It’s for sure working now so happy days :slight_smile:


#15

Well, I are a developer :joy:
But I’ll never know everything, so was looking to learn a bit. Also I was curious how Cloudflare reacts to browser requests (like not caching an image). I wonder if it caches the image anyway since it’s not a browser.


#16

My understanding is this was not related to Cloudflare at all but some server-side issue (caching or something else).


#17

I think it was both. This was the second recent post having to do with Cloudflare in front of a password protected site. It’d be nice to have a decent set of knowledge for future similar posts.


#18

But what should the issue have been with Cloudflare? Cloudflare does cache files, that we know :slight_smile:


#19

It’s about the integration of Cloudflare with different types of sites. Static, Wordpress and other CMSs, eCommerce, and in this case: user login with private resources.

I thought with little tweaking of Rules the issue could be resolved. @tmp went with a server-side solution so I was curious about it, to see how well it works, and how it works with CF.


#20

Its still not clear to me how that is related to Cloudflare and caching files it proxies. Cloudflare does not care if you have files served from actual files or dynamically via some scripts. It caches what it caches and the OP’s misunderstanding of that seems to have been the issue here.