Feasibility of CloudFront caching

0

I've been using CloudFlare for a bit, but have found it too restrictive in terms of customisability without having an enterprise plan. I want to give CloudFront a try, but just want to investigate the feasibility and ease of doing what I need to do before diving into the whole thing.

Basically, I have a site, domain.com, and then several subdomain sites running MediaWiki, *.domain.com. I'd like to always cache domain.com, and need to cache *.domain.com sites based on a variety of things. Firstly, I want to assume that everything can be cached. Then, I need to check if there is a cookie wgSessionUser present (the cookie could have any value, so I'd essentially just like to check for the cookie, it doesn't really matter what the value is, as long as it exists). If the cookie exists, then I'd like to bypass CloudFront and pass the request to the origin—to prevent logged in users being hit by the cache, which causes all sorts of issues. Moreover, I also want to bypass the cache if the url contains specific keywords (such as File:, Special:, etc.).

In my head this is a relatively straight forward thing, but I'm not entirely sure on CloudFront capabilities and how this stacks up with CloudFlare's offerings. Can anyone just let me know if this is feasible, and if so, how difficult?

Tips and help resources appreciated :)

LRZXFT
gefragt vor 8 Monaten238 Aufrufe
1 Antwort
1
Akzeptierte Antwort

On the face of it, yes CloudFront can do what it is you are looking for.

Your starting point of "everything can be cached", yes CloudFront can do that.

Checking for the presence (or absence) of a particular cookie falls under CachePolicyCookiesConfig data type https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CachePolicyCookiesConfig.html

Checking whether any part of the URL matches a specific string would fall under PathPattern within CacheBehavior https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_CacheBehavior.html

profile picture
EXPERTE
Steve_M
beantwortet vor 8 Monaten
profile picture
EXPERTE
überprüft vor 7 Tagen
  • Thank you kindly!

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen