ELB with sticky session (AWS) cf-cache-status: BYPASS


I work in a non profit sports federation with a large traffic Wordpress site on AWS with autoscaling and load balancing.

Out of the box I prefer Cloudflare to the AWS CDN (Cloudfront) and have recently activated APO + Argo on our domain.

We are happy with the performance except for one thing: I can’t seem to get Cloudflare to cache images, we always get a BYPASS status code no matter what we configure.

I have also setup the DEV server with APO (also on AWS but without the load balancing and auto scaling).

The DEV server in return gets a HIT status, so that brings me on to the question.

Is Cloudflare compatible con ELB with sticky sessions on AWS?
If so what are the optimal settings?

Main server with ELB

DEV server

Any help would be appreciated.

Thanks in advance.

If I’m not mistaken, AWS ELB will assign a cookie for each response. Cloudflare will not cache the resources if there’s a cookie in the response.

Refer to this post:

Ok, thanks for the information. I already saw that post so I’m guessing that it’s not compatible with ELB. I’ll try without stick sessions and if that fails to fix the problem I’ll need to rethink things out.
Maybe go with load balancing on Cloudflare or as a last resort deploy the CDN on AWS (I was hoping to avoid this and keep on using APO and other Cloudflare services).


1 Like

Cloudflare Load Balancer should be just fine (unless your AWS deployment has Auto Scaling group that will add/remove instances over time based on server load, then AWS ELB might be a better option).

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.