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
질문됨 8달 전233회 조회
1개 답변
1
수락된 답변

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
전문가
Steve_M
답변함 8달 전
profile picture
전문가
검토됨 4일 전
  • Thank you kindly!

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠