Caching static html using bypass cache page rule

cache
#1

My website runs on AEM and i do have lots of API json calls using the same domain name. If i want to do a caching of some of the HTML pages as mentioned in one of the support forums : How to cache static html

Cache level : everything
By pass cache : XXXX

it ends up caching all the pages starting with my domain name. How do i author my by pass cache page rule for this html page. Below is a sample from one of my html page’s request header

authority: www.sample.com
:method: GET
:path: /destination
:scheme: https
accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3
accept-encoding: gzip, deflate, br
accept-language: en-US,en;q=0.9,ta;q=0.8
cookie: __cfduid=da36cbdceb2713c1186d99e0690f9b64f1556128612; _ga=GA1.2.1192018932.1556128621; _gid=GA1.2.998888092.1556128621; G_ENABLED_IDPS=google; _fbp=fb.1.1556128621541.1067088236; promo=test; AWSELB=6B7F530F1AF737D838C2CAFCD4BFFE4E802B4AE458C9681555DBB1D05CF5FFB95950B0C25EB85BE59D4188C72D65D6596FC66D45EBAE8E09B5FCF5EB2DD552114232CC76B8; _gat_gtag_UA_130577597_1=1
dnt: 1
referer: https://www.sample.com/resorts-hotels
upgrade-insecure-requests: 1
user-agent: Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Mobile Safari/537.36

#2

To limit the scope of Cache Everything, you’ll need to restrict the Match with a path or a wildcard. You may need to use multiple Page Rules if you have a variety of specific paths you want cached.

-or- do the reverse, where you have that Cache Everything set that is caching everything, but put some rules before that to match *.html that will Bypass Cache for specific paths.

2 Likes
#3

Thanks sdayman.
I have created multiple page rules to cache my static pages. But the onload event time has increased eventually.