Files
nexus/sreweekly/articles/188/06-all-you-need-to-know-about-caching-for-serverless-applications.html
2026-09-12 17:23:01 +08:00

566 lines
84 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="https://gmpg.org/xfn/11">
<meta name='robots' content='index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1' />
<!-- This site is optimized with the Yoast SEO Premium plugin v22.5 (Yoast SEO v22.5) - https://yoast.com/wordpress/plugins/seo/ -->
<title>All you need to know about caching for serverless applications | theburningmonk.com</title>
<meta name="description" content="Here&#039;s the ultimate guide to serverless caching, with all the places where you can add caching in a serverless architecture." />
<link rel="canonical" href="https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/" />
<meta property="og:locale" content="en_US" />
<meta property="og:type" content="article" />
<meta property="og:title" content="All you need to know about caching for serverless applications" />
<meta property="og:description" content="Here&#039;s the ultimate guide to serverless caching, with all the places where you can add caching in a serverless architecture." />
<meta property="og:url" content="https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/" />
<meta property="og:site_name" content="theburningmonk.com" />
<meta property="article:published_time" content="2019-10-02T23:00:42+00:00" />
<meta property="article:modified_time" content="2024-11-18T00:02:12+00:00" />
<meta property="og:image" content="https://theburningmonk.com/wp-content/uploads/2019/10/serverless-caching-1-1024x575.png" />
<meta property="og:image:width" content="1024" />
<meta property="og:image:height" content="575" />
<meta property="og:image:type" content="image/png" />
<meta name="author" content="Yan Cui" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:creator" content="@theburningmonk" />
<meta name="twitter:site" content="@theburningmonk" />
<meta name="twitter:label1" content="Written by" />
<meta name="twitter:data1" content="Yan Cui" />
<meta name="twitter:label2" content="Est. reading time" />
<meta name="twitter:data2" content="9 minutes" />
<script type="application/ld+json" class="yoast-schema-graph">{"@context":"https://schema.org","@graph":[{"@type":"Article","@id":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/#article","isPartOf":{"@id":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/"},"author":{"name":"Yan Cui","@id":"https://theburningmonk.com/#/schema/person/6b58679b4aa29db4f537a76fd0923ad4"},"headline":"All you need to know about caching for serverless applications","datePublished":"2019-10-02T23:00:42+00:00","dateModified":"2024-11-18T00:02:12+00:00","mainEntityOfPage":{"@id":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/"},"wordCount":1342,"publisher":{"@id":"https://theburningmonk.com/#/schema/person/6b58679b4aa29db4f537a76fd0923ad4"},"image":{"@id":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/#primaryimage"},"thumbnailUrl":"/wp-content/uploads/2019/10/serverless-caching-1.png","keywords":["API Gateway","AWS","CloudFront","DynamoDB","Lambda","Programming","Serverless"],"articleSection":["API Gateway","AWS","CloudFront","DynamoDB","Lambda","Programming","Serverless"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/","url":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/","name":"All you need to know about caching for serverless applications | theburningmonk.com","isPartOf":{"@id":"https://theburningmonk.com/#website"},"primaryImageOfPage":{"@id":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/#primaryimage"},"image":{"@id":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/#primaryimage"},"thumbnailUrl":"/wp-content/uploads/2019/10/serverless-caching-1.png","datePublished":"2019-10-02T23:00:42+00:00","dateModified":"2024-11-18T00:02:12+00:00","description":"Here's the ultimate guide to serverless caching, with all the places where you can add caching in a serverless architecture.","breadcrumb":{"@id":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/#primaryimage","url":"/wp-content/uploads/2019/10/serverless-caching-1.png","contentUrl":"/wp-content/uploads/2019/10/serverless-caching-1.png","width":1024,"height":575},{"@type":"BreadcrumbList","@id":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://theburningmonk.com/"},{"@type":"ListItem","position":2,"name":"All you need to know about caching for serverless applications"}]},{"@type":"WebSite","@id":"https://theburningmonk.com/#website","url":"https://theburningmonk.com/","name":"theburningmonk.com","description":"Learn to build production-ready serverless applications on AWS","publisher":{"@id":"https://theburningmonk.com/#/schema/person/6b58679b4aa29db4f537a76fd0923ad4"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://theburningmonk.com/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https://theburningmonk.com/#/schema/person/6b58679b4aa29db4f537a76fd0923ad4","name":"Yan Cui","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https://theburningmonk.com/#/schema/person/image/","url":"https://secure.gravatar.com/avatar/72bd46b920d5a3384991055b95afbb0499f86b7af18cf9ad7e04156a8c181ad4?s=96&d=mm&r=g","contentUrl":"https://secure.gravatar.com/avatar/72bd46b920d5a3384991055b95afbb0499f86b7af18cf9ad7e04156a8c181ad4?s=96&d=mm&r=g","caption":"Yan Cui"},"logo":{"@id":"https://theburningmonk.com/#/schema/person/image/"},"description":"I help engineers build better software faster with serverless. AWS Serverless Hero, Independent Consultant"}]}</script>
<!-- / Yoast SEO Premium plugin. -->
<link rel='dns-prefetch' href='//a.omappapi.com' />
<!-- theburningmonk.com is managing ads with Advanced Ads --><script id="a2280-ready">
window.advanced_ads_ready=function(e,a){a=a||"complete";var d=function(e){return"interactive"===a?"loading"!==e:"complete"===e};d(document.readyState)?e():document.addEventListener("readystatechange",(function(a){d(a.target.readyState)&&e()}),{once:"interactive"===a})},window.advanced_ads_ready_queue=window.advanced_ads_ready_queue||[]; </script>
<style id='wp-img-auto-sizes-contain-inline-css' type='text/css'>
img:is([sizes=auto i],[sizes^="auto," i]){contain-intrinsic-size:3000px 1500px}
/*# sourceURL=wp-img-auto-sizes-contain-inline-css */
</style>
<link rel='stylesheet' id='wgs2-css' href='/wp-content/plugins/wp-google-search/wgs2.css?ver=6.9.4' type='text/css' media='all' />
<link rel='stylesheet' id='astra-theme-css-css' href='/wp-content/themes/astra/assets/css/minified/style.min.css?ver=1.6.2' type='text/css' media='all' />
<style id='astra-theme-css-inline-css' type='text/css'>
html{font-size:93.75%;}a,.page-title{color:#0274be;}a:hover,a:focus{color:#3a3a3a;}body,button,input,select,textarea{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-weight:normal;font-size:15px;font-size:1rem;}blockquote{border-color:rgba(2,116,190,0.05);}.site-title{font-size:35px;font-size:2.3333333333333rem;}header .site-logo-img .custom-logo-link img{max-width:0px;}.astra-logo-svg{width:0px;}.ast-archive-description .ast-archive-title{font-size:40px;font-size:2.6666666666667rem;}.site-header .site-description{font-size:15px;font-size:1rem;}.entry-title{font-size:30px;font-size:2rem;}.comment-reply-title{font-size:24px;font-size:1.6rem;}.ast-comment-list #cancel-comment-reply-link{font-size:15px;font-size:1rem;}h1,.entry-content h1,.entry-content h1 a{font-size:48px;font-size:3.2rem;}h2,.entry-content h2,.entry-content h2 a{font-size:42px;font-size:2.8rem;}h3,.entry-content h3,.entry-content h3 a{font-size:30px;font-size:2rem;}h4,.entry-content h4,.entry-content h4 a{font-size:20px;font-size:1.3333333333333rem;}h5,.entry-content h5,.entry-content h5 a{font-size:18px;font-size:1.2rem;}h6,.entry-content h6,.entry-content h6 a{font-size:15px;font-size:1rem;}.ast-single-post .entry-title,.page-title{font-size:30px;font-size:2rem;}#secondary,#secondary button,#secondary input,#secondary select,#secondary textarea{font-size:15px;font-size:1rem;}::selection{background-color:#0274be;color:#ffffff;}body,h1,.entry-title a,.entry-content h1,.entry-content h1 a,h2,.entry-content h2,.entry-content h2 a,h3,.entry-content h3,.entry-content h3 a,h4,.entry-content h4,.entry-content h4 a,h5,.entry-content h5,.entry-content h5 a,h6,.entry-content h6,.entry-content h6 a{color:#3a3a3a;}.tagcloud a:hover,.tagcloud a:focus,.tagcloud a.current-item{color:#ffffff;border-color:#0274be;background-color:#0274be;}.main-header-menu a,.ast-header-custom-item a{color:#3a3a3a;}.main-header-menu li:hover > a,.main-header-menu li:hover > .ast-menu-toggle,.main-header-menu .ast-masthead-custom-menu-items a:hover,.main-header-menu li.focus > a,.main-header-menu li.focus > .ast-menu-toggle,.main-header-menu .current-menu-item > a,.main-header-menu .current-menu-ancestor > a,.main-header-menu .current_page_item > a,.main-header-menu .current-menu-item > .ast-menu-toggle,.main-header-menu .current-menu-ancestor > .ast-menu-toggle,.main-header-menu .current_page_item > .ast-menu-toggle{color:#0274be;}input:focus,input[type="text"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="password"]:focus,input[type="reset"]:focus,input[type="search"]:focus,textarea:focus{border-color:#0274be;}input[type="radio"]:checked,input[type=reset],input[type="checkbox"]:checked,input[type="checkbox"]:hover:checked,input[type="checkbox"]:focus:checked,input[type=range]::-webkit-slider-thumb{border-color:#0274be;background-color:#0274be;box-shadow:none;}.site-footer a:hover + .post-count,.site-footer a:focus + .post-count{background:#0274be;border-color:#0274be;}.footer-adv .footer-adv-overlay{border-top-style:solid;border-top-color:#7a7a7a;}.ast-comment-meta{line-height:1.666666667;font-size:12px;font-size:0.8rem;}.single .nav-links .nav-previous,.single .nav-links .nav-next,.single .ast-author-details .author-title,.ast-comment-meta{color:#0274be;}.menu-toggle,button,.ast-button,.button,input#submit,input[type="button"],input[type="submit"],input[type="reset"]{border-radius:2px;padding:10px 40px;color:#ffffff;border-color:#0274be;background-color:#0274be;}button:focus,.menu-toggle:hover,button:hover,.ast-button:hover,.button:hover,input[type=reset]:hover,input[type=reset]:focus,input#submit:hover,input#submit:focus,input[type="button"]:hover,input[type="button"]:focus,input[type="submit"]:hover,input[type="submit"]:focus{color:#ffffff;border-color:#3a3a3a;background-color:#3a3a3a;}.entry-meta,.entry-meta *{line-height:1.45;color:#0274be;}.entry-meta a:hover,.entry-meta a:hover *,.entry-meta a:focus,.entry-meta a:focus *{color:#3a3a3a;}blockquote,blockquote a{color:#000000;}.ast-404-layout-1 .ast-404-text{font-size:200px;font-size:13.333333333333rem;}.widget-title{font-size:21px;font-size:1.4rem;color:#3a3a3a;}#cat option,.secondary .calendar_wrap thead a,.secondary .calendar_wrap thead a:visited{color:#0274be;}.secondary .calendar_wrap #today,.ast-progress-val span{background:#0274be;}.secondary a:hover + .post-count,.secondary a:focus + .post-count{background:#0274be;border-color:#0274be;}.calendar_wrap #today > a{color:#ffffff;}.ast-pagination a,.page-links .page-link,.single .post-navigation a{color:#0274be;}.ast-pagination a:hover,.ast-pagination a:focus,.ast-pagination > span:hover:not(.dots),.ast-pagination > span.current,.page-links > .page-link,.page-links .page-link:hover,.post-navigation a:hover{color:#3a3a3a;}.ast-header-break-point .ast-mobile-menu-buttons-minimal.menu-toggle{background:transparent;color:#0274be;}.ast-header-break-point .ast-mobile-menu-buttons-outline.menu-toggle{background:transparent;border:1px solid #0274be;color:#0274be;}.ast-header-break-point .ast-mobile-menu-buttons-fill.menu-toggle{background:#0274be;}.ast-header-break-point .main-header-bar .ast-button-wrap .menu-toggle{border-radius:0px;}@media (min-width:545px){.ast-page-builder-template .comments-area,.single.ast-page-builder-template .entry-header,.single.ast-page-builder-template .post-navigation{max-width:1440px;margin-left:auto;margin-right:auto;}}body,.ast-separate-container{background-color:#ffffff;}@media (max-width:768px){.ast-archive-description .ast-archive-title{font-size:40px;}.entry-title{font-size:30px;}h1,.entry-content h1,.entry-content h1 a{font-size:30px;}h2,.entry-content h2,.entry-content h2 a{font-size:25px;}h3,.entry-content h3,.entry-content h3 a{font-size:20px;}.ast-single-post .entry-title,.page-title{font-size:30px;}}@media (max-width:544px){.ast-archive-description .ast-archive-title{font-size:40px;}.entry-title{font-size:30px;}h1,.entry-content h1,.entry-content h1 a{font-size:30px;}h2,.entry-content h2,.entry-content h2 a{font-size:25px;}h3,.entry-content h3,.entry-content h3 a{font-size:20px;}.ast-single-post .entry-title,.page-title{font-size:30px;}}@media (max-width:768px){html{font-size:85.5%;}}@media (max-width:544px){html{font-size:85.5%;}}@media (min-width:769px){.ast-container{max-width:1440px;}}@font-face {font-family: "Astra";src: url( https://theburningmonk.com/wp-content/themes/astra/assets/fonts/astra.woff) format("woff"),url( https://theburningmonk.com/wp-content/themes/astra/assets/fonts/astra.ttf) format("truetype"),url( https://theburningmonk.com/wp-content/themes/astra/assets/fonts/astra.svg#astra) format("svg");font-weight: normal;font-style: normal;}@media (max-width:921px) {.main-header-bar .main-header-bar-navigation{display:none;}}.ast-desktop .main-header-menu.submenu-with-border .sub-menu,.ast-desktop .main-header-menu.submenu-with-border .children,.ast-desktop .main-header-menu.submenu-with-border .astra-full-megamenu-wrapper{border-color:#eaeaea;}.ast-desktop .main-header-menu.submenu-with-border .sub-menu,.ast-desktop .main-header-menu.submenu-with-border .children{border-top-width:1px;border-right-width:1px;border-left-width:1px;border-bottom-width:1px;border-style:solid;}.ast-desktop .main-header-menu.submenu-with-border .sub-menu .sub-menu,.ast-desktop .main-header-menu.submenu-with-border .children .children{top:-1px;}.ast-desktop .main-header-menu.submenu-with-border .sub-menu a,.ast-desktop .main-header-menu.submenu-with-border .children a{border-bottom-width:1px;border-style:solid;border-color:#eaeaea;}@media (min-width:769px){.main-header-menu .sub-menu li.ast-left-align-sub-menu:hover > ul,.main-header-menu .sub-menu li.ast-left-align-sub-menu.focus > ul{margin-left:-2px;}}.ast-small-footer{border-top-style:solid;border-top-width:1px;border-top-color:#7a7a7a;}@media (max-width:920px){.ast-404-layout-1 .ast-404-text{font-size:100px;font-size:6.6666666666667rem;}}
.ast-header-break-point .site-header{border-bottom-width:3px;}@media (min-width:769px){.main-header-bar{border-bottom-width:3px;}}@media (min-width:769px){#primary{width:70%;}#secondary{width:30%;}}.ast-flex{-webkit-align-content:center;-ms-flex-line-pack:center;align-content:center;-webkit-box-align:center;-webkit-align-items:center;-moz-box-align:center;-ms-flex-align:center;align-items:center;}.main-header-bar{padding:1em 0;}.ast-site-identity{padding:0;}
/*# sourceURL=astra-theme-css-inline-css */
</style>
<style id='wp-emoji-styles-inline-css' type='text/css'>
img.wp-smiley, img.emoji {
display: inline !important;
border: none !important;
box-shadow: none !important;
height: 1em !important;
width: 1em !important;
margin: 0 0.07em !important;
vertical-align: -0.1em !important;
background: none !important;
padding: 0 !important;
}
/*# sourceURL=wp-emoji-styles-inline-css */
</style>
<link rel='stylesheet' id='wp-block-library-css' href='/wp-includes/css/dist/block-library/style.min.css?ver=6.9.4' type='text/css' media='all' />
<style id='classic-theme-styles-inline-css' type='text/css'>
/*! This file is auto-generated */
.wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none}
/*# sourceURL=/wp-includes/css/classic-themes.min.css */
</style>
<link rel='stylesheet' id='convertkit-broadcasts-css' href='/wp-content/plugins/convertkit/resources/frontend/css/broadcasts.css?ver=2.5.5' type='text/css' media='all' />
<link rel='stylesheet' id='convertkit-button-css' href='/wp-content/plugins/convertkit/resources/frontend/css/button.css?ver=2.5.5' type='text/css' media='all' />
<link rel='stylesheet' id='convertkit-form-css' href='/wp-content/plugins/convertkit/resources/frontend/css/form.css?ver=2.5.5' type='text/css' media='all' />
<style id='global-styles-inline-css' type='text/css'>
:root{--wp--preset--aspect-ratio--square: 1;--wp--preset--aspect-ratio--4-3: 4/3;--wp--preset--aspect-ratio--3-4: 3/4;--wp--preset--aspect-ratio--3-2: 3/2;--wp--preset--aspect-ratio--2-3: 2/3;--wp--preset--aspect-ratio--16-9: 16/9;--wp--preset--aspect-ratio--9-16: 9/16;--wp--preset--color--black: #000000;--wp--preset--color--cyan-bluish-gray: #abb8c3;--wp--preset--color--white: #ffffff;--wp--preset--color--pale-pink: #f78da7;--wp--preset--color--vivid-red: #cf2e2e;--wp--preset--color--luminous-vivid-orange: #ff6900;--wp--preset--color--luminous-vivid-amber: #fcb900;--wp--preset--color--light-green-cyan: #7bdcb5;--wp--preset--color--vivid-green-cyan: #00d084;--wp--preset--color--pale-cyan-blue: #8ed1fc;--wp--preset--color--vivid-cyan-blue: #0693e3;--wp--preset--color--vivid-purple: #9b51e0;--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple: linear-gradient(135deg,rgb(6,147,227) 0%,rgb(155,81,224) 100%);--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan: linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%);--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange: linear-gradient(135deg,rgb(252,185,0) 0%,rgb(255,105,0) 100%);--wp--preset--gradient--luminous-vivid-orange-to-vivid-red: linear-gradient(135deg,rgb(255,105,0) 0%,rgb(207,46,46) 100%);--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray: linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%);--wp--preset--gradient--cool-to-warm-spectrum: linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%);--wp--preset--gradient--blush-light-purple: linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%);--wp--preset--gradient--blush-bordeaux: linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%);--wp--preset--gradient--luminous-dusk: linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%);--wp--preset--gradient--pale-ocean: linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%);--wp--preset--gradient--electric-grass: linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%);--wp--preset--gradient--midnight: linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%);--wp--preset--font-size--small: 13px;--wp--preset--font-size--medium: 20px;--wp--preset--font-size--large: 36px;--wp--preset--font-size--x-large: 42px;--wp--preset--spacing--20: 0.44rem;--wp--preset--spacing--30: 0.67rem;--wp--preset--spacing--40: 1rem;--wp--preset--spacing--50: 1.5rem;--wp--preset--spacing--60: 2.25rem;--wp--preset--spacing--70: 3.38rem;--wp--preset--spacing--80: 5.06rem;--wp--preset--shadow--natural: 6px 6px 9px rgba(0, 0, 0, 0.2);--wp--preset--shadow--deep: 12px 12px 50px rgba(0, 0, 0, 0.4);--wp--preset--shadow--sharp: 6px 6px 0px rgba(0, 0, 0, 0.2);--wp--preset--shadow--outlined: 6px 6px 0px -3px rgb(255, 255, 255), 6px 6px rgb(0, 0, 0);--wp--preset--shadow--crisp: 6px 6px 0px rgb(0, 0, 0);}:where(.is-layout-flex){gap: 0.5em;}:where(.is-layout-grid){gap: 0.5em;}body .is-layout-flex{display: flex;}.is-layout-flex{flex-wrap: wrap;align-items: center;}.is-layout-flex > :is(*, div){margin: 0;}body .is-layout-grid{display: grid;}.is-layout-grid > :is(*, div){margin: 0;}:where(.wp-block-columns.is-layout-flex){gap: 2em;}:where(.wp-block-columns.is-layout-grid){gap: 2em;}:where(.wp-block-post-template.is-layout-flex){gap: 1.25em;}:where(.wp-block-post-template.is-layout-grid){gap: 1.25em;}.has-black-color{color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-color{color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-color{color: var(--wp--preset--color--white) !important;}.has-pale-pink-color{color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-color{color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-color{color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-color{color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-color{color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-color{color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-color{color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-color{color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-color{color: var(--wp--preset--color--vivid-purple) !important;}.has-black-background-color{background-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-background-color{background-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-background-color{background-color: var(--wp--preset--color--white) !important;}.has-pale-pink-background-color{background-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-background-color{background-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-background-color{background-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-background-color{background-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-background-color{background-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-background-color{background-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-background-color{background-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-background-color{background-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-background-color{background-color: var(--wp--preset--color--vivid-purple) !important;}.has-black-border-color{border-color: var(--wp--preset--color--black) !important;}.has-cyan-bluish-gray-border-color{border-color: var(--wp--preset--color--cyan-bluish-gray) !important;}.has-white-border-color{border-color: var(--wp--preset--color--white) !important;}.has-pale-pink-border-color{border-color: var(--wp--preset--color--pale-pink) !important;}.has-vivid-red-border-color{border-color: var(--wp--preset--color--vivid-red) !important;}.has-luminous-vivid-orange-border-color{border-color: var(--wp--preset--color--luminous-vivid-orange) !important;}.has-luminous-vivid-amber-border-color{border-color: var(--wp--preset--color--luminous-vivid-amber) !important;}.has-light-green-cyan-border-color{border-color: var(--wp--preset--color--light-green-cyan) !important;}.has-vivid-green-cyan-border-color{border-color: var(--wp--preset--color--vivid-green-cyan) !important;}.has-pale-cyan-blue-border-color{border-color: var(--wp--preset--color--pale-cyan-blue) !important;}.has-vivid-cyan-blue-border-color{border-color: var(--wp--preset--color--vivid-cyan-blue) !important;}.has-vivid-purple-border-color{border-color: var(--wp--preset--color--vivid-purple) !important;}.has-vivid-cyan-blue-to-vivid-purple-gradient-background{background: var(--wp--preset--gradient--vivid-cyan-blue-to-vivid-purple) !important;}.has-light-green-cyan-to-vivid-green-cyan-gradient-background{background: var(--wp--preset--gradient--light-green-cyan-to-vivid-green-cyan) !important;}.has-luminous-vivid-amber-to-luminous-vivid-orange-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-amber-to-luminous-vivid-orange) !important;}.has-luminous-vivid-orange-to-vivid-red-gradient-background{background: var(--wp--preset--gradient--luminous-vivid-orange-to-vivid-red) !important;}.has-very-light-gray-to-cyan-bluish-gray-gradient-background{background: var(--wp--preset--gradient--very-light-gray-to-cyan-bluish-gray) !important;}.has-cool-to-warm-spectrum-gradient-background{background: var(--wp--preset--gradient--cool-to-warm-spectrum) !important;}.has-blush-light-purple-gradient-background{background: var(--wp--preset--gradient--blush-light-purple) !important;}.has-blush-bordeaux-gradient-background{background: var(--wp--preset--gradient--blush-bordeaux) !important;}.has-luminous-dusk-gradient-background{background: var(--wp--preset--gradient--luminous-dusk) !important;}.has-pale-ocean-gradient-background{background: var(--wp--preset--gradient--pale-ocean) !important;}.has-electric-grass-gradient-background{background: var(--wp--preset--gradient--electric-grass) !important;}.has-midnight-gradient-background{background: var(--wp--preset--gradient--midnight) !important;}.has-small-font-size{font-size: var(--wp--preset--font-size--small) !important;}.has-medium-font-size{font-size: var(--wp--preset--font-size--medium) !important;}.has-large-font-size{font-size: var(--wp--preset--font-size--large) !important;}.has-x-large-font-size{font-size: var(--wp--preset--font-size--x-large) !important;}
/*# sourceURL=global-styles-inline-css */
</style>
<link rel='stylesheet' id='crp-public-css' href='/wp-content/plugins/custom-related-posts/dist/public.css?ver=1.7.2' type='text/css' media='all' />
<link rel='stylesheet' id='elementor-frontend-css' href='/wp-content/plugins/elementor/assets/css/frontend.min.css?ver=3.17.1' type='text/css' media='all' />
<link rel='stylesheet' id='eael-general-css' href='/wp-content/plugins/essential-addons-for-elementor-lite/assets/front-end/css/view/general.min.css?ver=5.8.13' type='text/css' media='all' />
<script type="text/javascript" src="/wp-includes/js/jquery/jquery.min.js?ver=3.7.1" id="jquery-core-js"></script>
<script type="text/javascript" src="/wp-includes/js/jquery/jquery-migrate.min.js?ver=3.4.1" id="jquery-migrate-js"></script>
<script type="text/javascript" src="/wp-content/plugins/sticky-menu-or-anything-on-scroll/assets/js/jq-sticky-anything.min.js?ver=2.1.1" id="stickyAnythingLib-js"></script>
<meta name="generator" content="WordPress 6.9.4" />
<!-- Meta Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', '1053262429148154');
fbq('track', 'PageView');
</script>
<noscript><img height="1" width="1" style="display:none"
src="https://www.facebook.com/tr?id=1053262429148154&ev=PageView&noscript=1"
/></noscript>
<!-- End Meta Pixel Code -->
<meta name="generator" content="Elementor 3.17.1; features: e_dom_optimization, e_optimized_assets_loading, additional_custom_breakpoints; settings: css_print_method-external, google_font-enabled, font_display-auto">
<style type="text/css" id="syntaxhighlighteranchor"></style>
<style>ins.adsbygoogle { background-color: transparent; padding: 0; }</style><link rel="icon" href="/wp-content/uploads/2018/03/favicon-150x150.png" sizes="32x32" />
<link rel="icon" href="/wp-content/uploads/2018/03/favicon-300x300.png" sizes="192x192" />
<link rel="apple-touch-icon" href="/wp-content/uploads/2018/03/favicon-300x300.png" />
<meta name="msapplication-TileImage" content="/wp-content/uploads/2018/03/favicon-300x300.png" />
<style type="text/css" id="wp-custom-css">
.grecaptcha-badge {
display: none;
} </style>
<link rel='stylesheet' id='basecss-css' href='/wp-content/plugins/eu-cookie-law/css/style.css?ver=6.9.4' type='text/css' media='all' />
<link rel='stylesheet' id='lwptoc-main-css' href='/wp-content/plugins/luckywp-table-of-contents/front/assets/main.min.css?ver=2.1.4' type='text/css' media='all' />
</head>
<body itemtype='https://schema.org/Blog' itemscope='itemscope' class="wp-singular post-template-default single single-post postid-9252 single-format-standard wp-theme-astra ast-desktop ast-separate-container ast-right-sidebar astra-1.6.2 ast-header-custom-item-inside ast-blog-single-style-1 ast-single-post ast-inherit-site-logo-transparent ast-normal-title-enabled elementor-default elementor-kit-10350 aa-prefix-a2280-">
<div id="page" class="hfeed site">
<a class="skip-link screen-reader-text" href="#content">Skip to content</a>
<header itemtype="https://schema.org/WPHeader" itemscope="itemscope" id="masthead" class="site-header header-main-layout-2 ast-primary-menu-enabled ast-menu-toggle-icon ast-mobile-header-stack" role="banner">
<div class="main-header-bar-wrap">
<div class="main-header-bar">
<div class="ast-container">
<div class="ast-flex main-header-container">
<div class="site-branding">
<div class="ast-site-identity" itemscope="itemscope" itemtype="https://schema.org/Organization">
</div>
</div>
<!-- .site-branding -->
<div class="ast-mobile-menu-buttons">
<div class="ast-button-wrap">
<button type="button" class="menu-toggle main-header-menu-toggle ast-mobile-menu-buttons-fill " rel="main-menu" aria-controls='primary-menu' aria-expanded='false'>
<span class="screen-reader-text">Main Menu</span>
<span class="menu-toggle-icon"></span>
</button>
</div>
</div>
<div class="ast-main-header-bar-alignment"><div class="main-header-bar-navigation"><nav itemtype="https://schema.org/SiteNavigationElement" itemscope="itemscope" id="site-navigation" class="ast-flex-grow-1" role="navigation" aria-label="Site Navigation"><div class="main-navigation"><ul id="primary-menu" class="main-header-menu ast-nav-menu ast-flex ast-justify-content-flex-end submenu-with-border"><li id="menu-item-14322" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-14322"><a href="/">Home</a></li>
<li id="menu-item-14002" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-14002"><a href="/posts">Blog</a></li>
<li id="menu-item-10416" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10416"><a href="/courses/">Courses</a></li>
<li id="menu-item-13640" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-13640"><a target="_blank" href="https://realworldserverless.com">Podcast</a></li>
<li id="menu-item-10532" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-10532"><a href="/hire-me/">Consulting</a></li>
</ul></div></nav></div></div> </div><!-- Main Header Container -->
</div><!-- ast-row -->
</div> <!-- Main Header Bar -->
</div> <!-- Main Header Bar Wrap -->
</header><!-- #masthead -->
<div id="content" class="site-content">
<div class="ast-container">
<div id="primary" class="content-area primary">
<main id="main" class="site-main" role="main">
<article itemtype="https://schema.org/CreativeWork" itemscope="itemscope" id="post-9252" class="post-9252 post type-post status-publish format-standard has-post-thumbnail hentry category-api-gateway category-aws category-cloudfront category-dynamodb category-lambda category-programming category-serverless tag-api-gateway tag-aws tag-cloudfront tag-dynamodb tag-lambda tag-programming tag-serverless ast-article-single">
<div class="ast-post-format- single-layout-1">
<header class="entry-header ">
<div class="post-thumb-img-content post-thumb"><img width="779" height="437" src="/wp-content/uploads/2019/10/serverless-caching-1-1024x575.png" class="attachment-large size-large wp-post-image" alt="" itemprop="image" decoding="async" srcset="/wp-content/uploads/2019/10/serverless-caching-1.png 1024w, /wp-content/uploads/2019/10/serverless-caching-1-300x169.png 300w, /wp-content/uploads/2019/10/serverless-caching-1-1536x863.png 1536w, /wp-content/uploads/2019/10/serverless-caching-1-2048x1151.png 2048w" sizes="(max-width: 779px) 100vw, 779px" /></div> <div class="ast-single-post-order">
<h1 class="entry-title" itemprop="headline">All you need to know about caching for serverless applications</h1><div class="entry-meta"><span class="tags-links"><a href="/tags/api-gateway/" rel="tag">API Gateway</a>, <a href="/tags/aws/" rel="tag">AWS</a>, <a href="/tags/cloudfront/" rel="tag">CloudFront</a>, <a href="/tags/dynamodb/" rel="tag">DynamoDB</a>, <a href="/tags/lambda/" rel="tag">Lambda</a>, <a href="/tags/programming/" rel="tag">Programming</a>, <a href="/tags/serverless/" rel="tag">Serverless</a></span></div> </div>
</header><!-- .entry-header -->
<div class="entry-content clear" itemprop="text">
<!-- Author meta information -->
<div style="display: flex; align-items: center; margin-top: 1em; margin-bottom: 1.8em;">
<img style="border-radius: 9999px;" src="https://res.cloudinary.com/theburningmonk/image/upload/f_auto,c_scale,w_90/theburningmonk.com/mugshot.png"/>
<div style="font-family: Arial, sans-serif; margin-left: 15px; display: flex; flex-direction: column; row-gap: 2px;">
<a href="/about" target="_blank"><p style="font-size: 1.4em; font-weight: bold; margin: 0">Yan Cui</p></a>
<p style="font-size: 1.2em; margin: 0; line-height: 1.2;">I help clients go faster for less using serverless technologies.</p>
</div>
</div>
<!--noindex--><div class="lwptoc lwptoc-dark lwptoc-notInherit" data-smooth-scroll="1" data-smooth-scroll-offset="0"><div class="lwptoc_i"> <div class="lwptoc_header">
<b class="lwptoc_title">Table of Content</b> </div>
<div class="lwptoc_items lwptoc_items-visible">
<div class="lwptoc_itemWrap"><div class="lwptoc_item"> <a href="#Caching_is_still_VERY_relevant" rel="nofollow">
<span class="lwptoc_item_label">Caching is still VERY relevant.</span>
</a>
</div><div class="lwptoc_item"> <a href="#Where_should_you_implement_caching" rel="nofollow">
<span class="lwptoc_item_label">Where should you implement caching?</span>
</a>
<div class="lwptoc_itemWrap"><div class="lwptoc_item"> <a href="#Caching_in_the_client_app" rel="nofollow">
<span class="lwptoc_item_label">Caching in the client app</span>
</a>
</div><div class="lwptoc_item"> <a href="#Caching_at_CloudFront" rel="nofollow">
<span class="lwptoc_item_label">Caching at CloudFront</span>
</a>
</div><div class="lwptoc_item"> <a href="#Caching_at_API_Gateway" rel="nofollow">
<span class="lwptoc_item_label">Caching at API Gateway</span>
</a>
</div><div class="lwptoc_item"> <a href="#Caching_in_the_Lambda_function" rel="nofollow">
<span class="lwptoc_item_label">Caching in the Lambda function</span>
</a>
</div><div class="lwptoc_item"> <a href="#Distributed_cache" rel="nofollow">
<span class="lwptoc_item_label">Distributed cache</span>
</a>
</div><div class="lwptoc_item"> <a href="#DAX" rel="nofollow">
<span class="lwptoc_item_label">DAX</span>
</a>
</div></div></div><div class="lwptoc_item"> <a href="#Summary" rel="nofollow">
<span class="lwptoc_item_label">Summary</span>
</a>
</div><div class="lwptoc_item"> <a href="#Links" rel="nofollow">
<span class="lwptoc_item_label">Links</span>
</a>
</div><div class="lwptoc_item"> <a href="#Related_Posts" rel="nofollow">
<span class="lwptoc_item_label">Related Posts</span>
</a>
</div></div></div>
</div></div><!--/noindex--><div class="a2280-before-content" style="margin-left: auto; margin-right: auto; text-align: center; margin-top: 40px; margin-bottom: 50px; " id="a2280-1230023838"><a href="https://productionreadyserverless.com/?utm_campaign=connect-the-dots&amp;utm_source=blog&amp;utm_medium=image-banner&amp;utm_content=variant3" target="_blank" aria-label="connect-the-dots-variant-3"><img loading="lazy" decoding="async" src="/wp-content/uploads/2024/03/connect-the-dots-variant-3-1.png" alt="" srcset="/wp-content/uploads/2024/03/connect-the-dots-variant-3-1.png 1024w, /wp-content/uploads/2024/03/connect-the-dots-variant-3-1-300x76.png 300w, /wp-content/uploads/2024/03/connect-the-dots-variant-3-1-779x198.png 779w" sizes="(max-width: 1024px) 100vw, 1024px" width="1024" height="260"></a></div><p>Caching is still important for serverless architectures. Just because AWS Lambda auto-scales by traffic, it doesn’t mean we can forget about caching. In this post, let’s break down by caching is still relevant for serverless and where we can apply caching in a serverless architecture.</p>
<h3 class="graf graf--h3"><span id="Caching_is_still_VERY_relevant">Caching is still VERY relevant.</span></h3>
<p class="graf graf--p">Yes, Lambda auto-scales by traffic. But it has limits. It takes time to reach your peak throughput.</p>
<p class="graf graf--p">This is not a problem if your traffic is either very stable or follows the bell curve so there are no sudden spikes.</p>
<p id="eYoORMO"><img decoding="async" width="1024" height="217" class="alignnone size-full wp-image-9253 " src="/wp-content/uploads/2019/09/img_5d912351d3d88.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d912351d3d88.png 1024w, /wp-content/uploads/2019/09/img_5d912351d3d88-300x64.png 300w" sizes="(max-width: 1024px) 100vw, 1024px"></p>
<p class="graf graf--p">However, if your traffic is very spiky, then you can still run into the various scaling limits:</p>
<ul>
<li>There is a region-wide account concurrency limit.</li>
<li>Individual functions can scale up by 1000 concurrent executions every 10 seconds.</li>
<li>If you have reserved concurrency configured on a function.</li>
</ul>
<p>These limits can impact businesses that are prone to seeing large spikes in user traffic. For instance, if you are streaming live events to millions of users or you’re in the food delivery service. In both cases, caching must be an integral part of your application.</p>
<p id="zvOxXjh"><img loading="lazy" decoding="async" width="1024" height="233" class="alignnone size-full wp-image-9254 " src="/wp-content/uploads/2019/09/img_5d912363e59e6.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d912363e59e6.png 1024w, /wp-content/uploads/2019/09/img_5d912363e59e6-300x68.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p class="graf graf--p">There’s the question of <strong class="markup--strong markup--p-strong">performance</strong> and <b>cost efficiency</b>.</p>
<p class="graf graf--p">Caching improves response time as it cuts out unnecessary roundtrips.</p>
<p class="graf graf--p">In the case of serverless, this also translates to cost savings as most of the technologies we use are pay-per-use. So, fewer requests directly translate to cost savings from requests that we didn’t have to process.</p>
<h3 class="graf graf--h3"><span id="Where_should_you_implement_caching">Where should you implement caching?</span></h3>
<p class="graf graf--p">A typical REST API might look like this:</p>
<p id="XEZjdpZ"><img loading="lazy" decoding="async" width="1024" height="205" class="alignnone size-full wp-image-9255 " src="/wp-content/uploads/2019/09/img_5d91237c82ab2.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d91237c82ab2.png 1024w, /wp-content/uploads/2019/09/img_5d91237c82ab2-300x60.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p class="graf graf--p">You have:</p>
<ul class="postList">
<li class="graf graf--li">Route53 as the DNS.</li>
<li class="graf graf--li">CloudFront as the CDN.</li>
<li class="graf graf--li">API Gateway to handle authentication, rate limiting and request validation.</li>
<li class="graf graf--li">Lambda to execute business logic.</li>
<li class="graf graf--li">DynamoDB as the database.</li>
</ul>
<p class="graf graf--p">In this very typical setup, you can implement caching in several places. My general preference is to <strong class="markup--strong markup--p-strong">cache as close to the end-user as possible</strong>, maximising your caching strategy’s cost-saving benefit.</p>
<h4 class="graf graf--h4"><span id="Caching_in_the_client_app">Caching in the client app</span></h4>
<p class="graf graf--p">Given the option, I will always enable caching in the web or mobile app.</p>
<p id="sznjXNE"><img loading="lazy" decoding="async" width="1024" height="263" class="alignnone size-full wp-image-9256 " src="/wp-content/uploads/2019/09/img_5d912394b66e1.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d912394b66e1.png 1024w, /wp-content/uploads/2019/09/img_5d912394b66e1-300x77.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p class="graf graf--p">This is very effective for data that are immutable or seldom change. For instance, browsers cache images and HTML markups to improve performance. The HTTP protocol has a rich set of headers to let you fine-tune the caching behaviour.</p>
<p class="graf graf--p">Often, client-side caching can be implemented easily using techniques such as <a class="markup--anchor markup--p-anchor" href="https://en.wikipedia.org/wiki/Memoization" target="_blank" rel="noopener noreferrer" data-href="https://en.wikipedia.org/wiki/Memoization">memoization</a> and encapsulated into reusable libraries.</p>
<p class="graf graf--p">However, caching data on the client side means responding to at least one request per client. This is still very inefficient, and you should also cache responses on the server side.</p>
<p id="nLRaMTH"><img loading="lazy" decoding="async" width="1024" height="253" class="alignnone size-full wp-image-9257 " src="/wp-content/uploads/2019/09/img_5d9123a8a37d5.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d9123a8a37d5.png 1024w, /wp-content/uploads/2019/09/img_5d9123a8a37d5-300x74.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<h4 class="graf graf--h4"><span id="Caching_at_CloudFront">Caching at CloudFront</span></h4>
<p class="graf graf--p">CloudFront has a built-in caching capability. It’s the first place you should consider caching on the server side.</p>
<p id="BtnMXLF"><img loading="lazy" decoding="async" width="1024" height="345" class="alignnone size-full wp-image-9258 " src="/wp-content/uploads/2019/09/img_5d9123b7645eb.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d9123b7645eb.png 1024w, /wp-content/uploads/2019/09/img_5d9123b7645eb-300x101.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p class="graf graf--p">Caching at the edge is very cost-efficient as it cuts out most of the calls to API Gateway and Lambda. Skipping these calls also improves the end-to-end latency and, ultimately, the user experience.</p>
<p class="graf graf--p">Also, by caching at the edge, you don’t need to modify your application code to enable caching.</p>
<p class="graf graf--p">CloudFront supports <a class="markup--anchor markup--p-anchor" href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html" target="_blank" rel="noopener noreferrer" data-href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html">caching by query strings</a>, <a class="markup--anchor markup--p-anchor" href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html" target="_blank" rel="noopener noreferrer" data-href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Cookies.html">cookies</a> and <a class="markup--anchor markup--p-anchor" href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html" target="_blank" rel="noopener noreferrer" data-href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html">request headers</a> [1]. It even supports <a class="markup--anchor markup--p-anchor" href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html" target="_blank" rel="noopener noreferrer" data-href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html">origin failover</a> [2], which can improve system uptime.</p>
<p class="graf graf--p">In most cases, this is the only server-side caching I need.</p>
<h4 class="graf graf--h4"><span id="Caching_at_API_Gateway">Caching at API Gateway</span></h4>
<p class="graf graf--p">CloudFront is great, but it, too, has limitations. For example, CloudFront only caches responses to GET, HEAD, and OPTIONS requests. If you need to cache other requests, you need to cache responses at the API Gateway layer instead.</p>
<p id="EfOBVIq"><img loading="lazy" decoding="async" width="1024" height="316" class="alignnone size-full wp-image-9259 " src="/wp-content/uploads/2019/09/img_5d9123ce18071.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d9123ce18071.png 1024w, /wp-content/uploads/2019/09/img_5d9123ce18071-300x92.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p class="graf graf--p">With API Gateway caching, you can cache responses to any request, including POST, PUT and PATCH. However, this is <a class="markup--anchor markup--p-anchor" href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html" target="_blank" rel="noopener noreferrer" data-href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html"><strong class="markup--strong markup--p-strong">not enabled by default</strong></a> [3].</p>
<p id="yGOYiND"><img loading="lazy" decoding="async" width="1024" height="154" class="alignnone size-full wp-image-9260 " src="/wp-content/uploads/2019/09/img_5d9123dfa72e6.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d9123dfa72e6.png 1024w, /wp-content/uploads/2019/09/img_5d9123dfa72e6-300x45.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p class="graf graf--p">You also have a lot more control over the cache key. For instance, if you have an endpoint with multiple path and/or query string parameters, e.g.</p>
<p class="graf graf--p"><em class="markup--em markup--p-em">    GET /{productId}?shipmentId={shipmentId}&amp;userId={userId}</em></p>
<p class="graf graf--p">You can choose which path and query string parameters are included in the cache key. In this case, it’s possible to use only the <code>productId</code> as the cache key. So, all requests to the same product ID would get the cached response, even if <code>shipmentId</code> and <code>userId</code> are different.</p>
<p class="graf graf--p">One downside to API Gateway caching is that you switch from pay-per-use pricing to paying for uptime. Essentially, you’ll be paying for the uptime of a Memcached node (that API Gateway manages for you).</p>
<p id="cwkoNKt"><img loading="lazy" decoding="async" width="1024" height="560" class="alignnone size-full wp-image-9261 " src="/wp-content/uploads/2019/09/img_5d9123f8094bd.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d9123f8094bd.png 1024w, /wp-content/uploads/2019/09/img_5d9123f8094bd-300x164.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p class="graf graf--p">API Gateway caching is powerful, but I have found few use cases for it. My main use case is for caching POST requests.</p>
<h4 class="graf graf--h4"><span id="Caching_in_the_Lambda_function">Caching in the Lambda function</span></h4>
<p class="graf graf--p">You can also cache data in the Lambda function. Anything declared outside the handler function is reused between invocations.</p>
<pre class="graf graf--pre">let html; // this is reused between invocations
const loadHtml = async () =&gt; {
if (!html) {
// load HTML from somewhere
// this is only run during cold start and then cached
}
return html
}
module.exports.handler = async (event) =&gt; {
return {
statusCode: 200,
body: await loadHtml(),
headers: {
'content-type': 'text/html; charset=UTF-8'
}
}
}</pre>
<p>Once created, an execution environment is reused to handle subsequent requests. You can take advantage of this and cache any static configurations or large objects in the Lambda function. This is indeed one of the recommendations from the official <a class="markup--anchor markup--p-anchor" href="https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html" target="_blank" rel="noopener noreferrer" data-href="https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html">best practices guide</a> [4].</p>
<p id="ZgWjrdE"><img loading="lazy" decoding="async" width="1024" height="148" class="alignnone size-full wp-image-9262 " src="/wp-content/uploads/2019/09/img_5d9124143db2e.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d9124143db2e.png 1024w, /wp-content/uploads/2019/09/img_5d9124143db2e-300x44.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p id="FRZHvYC"><img loading="lazy" decoding="async" width="1024" height="316" class="alignnone size-full wp-image-9263 " src="/wp-content/uploads/2019/09/img_5d91241d9f215.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d91241d9f215.png 1024w, /wp-content/uploads/2019/09/img_5d91241d9f215-300x93.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p class="graf graf--p">However, the cached data is only available for that execution environment, and there’s no way to share it with others. This means the overall cache miss can be pretty high – the first call in every execution environment will be a cache miss.</p>
<h4><span id="Distributed_cache">Distributed cache</span></h4>
<p class="graf graf--p">Alternatively, you can cache the data in a distributed cache instead. Doing so would allow cached data to be shared across many functions.</p>
<p class="graf graf--p">Elasticache requires your functions to be inside a VPC, and you must <a class="markup--anchor markup--p-anchor" href="https://aws.amazon.com/elasticache/pricing/" target="_blank" rel="noopener noreferrer" data-href="https://aws.amazon.com/elasticache/pricing/">pay for uptime</a> [5] for the Elasticache cluster.</p>
<p>A more serverless solution would be to use <a href="https://www.gomomento.com/" target="_blank" rel="noopener">Momento</a> [6] instead. Their serverless caching solution means no VPC and no need to manage cache nodes! They also have an on-demand pricing plan that is free for the first 5 GB and only $0.5 per GB thereafter.</p>
<p>However, introducing an external caching solution like Elasticache or Momento would require changes to your application code for both reads and writes.</p>
<p class="graf graf--p">If you use DynamoDB, then you can also use <a class="markup--anchor markup--p-anchor" href="https://aws.amazon.com/dynamodb/dax/" target="_blank" rel="noopener noreferrer" data-href="https://aws.amazon.com/dynamodb/dax/">DAX</a> as a convenient way to add caching to your application and reduce the read &amp; write costs of DynamoDB (which needs to be weighed against the cost of DAX itself).</p>
<h4 class="graf graf--h4"><span id="DAX">DAX</span></h4>
<p class="graf graf--p">DAX lets you benefit from Elasticache without running it yourself. You still have to pay for uptime for the cache nodes, but DynamoDB fully manages them.</p>
<p id="cPnXYyt"><img loading="lazy" decoding="async" width="1024" height="606" class="alignnone size-full wp-image-9264 " src="/wp-content/uploads/2019/09/img_5d9124353bc0e.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d9124353bc0e.png 1024w, /wp-content/uploads/2019/09/img_5d9124353bc0e-300x178.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p class="graf graf--p">The great thing about DAX is that it requires minimal change from your code. My main issue with DAX is its <a class="markup--anchor markup--p-anchor" href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.consistency.html#DAX.consistency.query-cache" target="_blank" rel="noopener noreferrer" data-href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.consistency.html#DAX.consistency.query-cache">caching behaviour</a> [7] regarding query and scan requests. In short, queries and scans have their own caches, and they’re not invalidated when the item cache is updated. This means they can return stale data immediately after an update.</p>
<p id="iqSLlGB"><img loading="lazy" decoding="async" width="1024" height="678" class="alignnone size-full wp-image-9265 " src="/wp-content/uploads/2019/09/img_5d912447bfebc.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d912447bfebc.png 1024w, /wp-content/uploads/2019/09/img_5d912447bfebc-300x199.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<h3 class="graf graf--h3"><span id="Summary">Summary</span></h3>
<p class="graf graf--p">To summarise, caching is still an important part of any serverless application. It improves your application’s scalability and performance and helps you keep your costs in check even when you have to scale to millions of users.</p>
<p class="graf graf--p">As discussed in this post, you can implement caching in every application layer. You should implement client-side caching and cache API responses at the edge with CloudFront as much as possible. When edge caching is not possible, move the caching further into your application to API Gateway, then Lambda or DAX.</p>
<p class="graf graf--p">If you’re not using DynamoDB or you need to cache data composed of different data sources, consider introducing Elasticache or Momento to the application.</p>
<p id="WftpUur"><img loading="lazy" decoding="async" width="1024" height="438" class="alignnone size-full wp-image-9266 " src="/wp-content/uploads/2019/09/img_5d912459f20ef.png" alt="" srcset="/wp-content/uploads/2019/09/img_5d912459f20ef.png 1024w, /wp-content/uploads/2019/09/img_5d912459f20ef-300x128.png 300w" sizes="auto, (max-width: 1024px) 100vw, 1024px"></p>
<p>&nbsp;</p>
<p>I hope you’ve found this post useful. If you want to learn more about running serverless in production and what it takes to build production-ready serverless applications, check out my upcoming workshop, <a href="https://productionreadyserverless.com/?utm_campaign=serverless-caching&amp;utm_source=blog" target="_blank" rel="noopener"><strong>Production-Ready Serverless</strong></a>!</p>
<p>In the workshop, I will give you complete, end-to-end training on building serverless applications for the real world. I will take you through topics such as:</p>
<ul>
<li>testing strategies</li>
<li>how to secure your APIs</li>
<li>API Gateway best practices</li>
<li>CI/CD</li>
<li>configuration management</li>
<li>security best practices</li>
<li>event-driven architectures</li>
<li>how to build observability into serverless applications</li>
</ul>
<p>and much more!</p>
<h3><span id="Links">Links</span></h3>
<p>[1] <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html" target="_blank" rel="noopener">CloudFront – caching content based on request headers</a></p>
<p>[2] <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html" target="_blank" rel="noopener">Optimizing high availability with CloudFront origin failover</a></p>
<p>[3] <a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-caching.html" target="_blank" rel="noopener">Enabling API caching to enhance responsiveness</a></p>
<p>[4] <a href="https://docs.aws.amazon.com/lambda/latest/dg/best-practices.html" target="_blank" rel="noopener">Official best practices guide for working with AWS Lambda</a></p>
<p>[5] <a href="https://aws.amazon.com/elasticache/pricing/" target="_blank" rel="noopener">Elasticache pricing</a></p>
<p>[6] <a href="https://gomomento.com/" target="_blank" rel="noopener">Momento serverless cache</a></p>
<p>[7] <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DAX.consistency.html#DAX.consistency.query-cache" target="_blank" rel="noopener">DAX query cache behaviour</a></p>
<h3 class="crp-list-title"><span id="Related_Posts">Related Posts</span></h3><div class="crp-list"><div class="crp-list-item crp-list-item-image-left crp-list-item-has-image"><div class="crp-list-item-image"><a href="/2020/11/how-i-built-a-social-network-in-4-weeks-with-graphql-and-serverless/"><img loading="lazy" decoding="async" data-pin-nopin="true" style="max-width: 128px; height: auto;" width="128" height="72" src="/wp-content/uploads/2020/11/social-network-4-weeks.title_-300x169.png" class="attachment-128x72 size-128x72 wp-post-image" alt="" srcset="/wp-content/uploads/2020/11/social-network-4-weeks.title_-300x169.png 300w, /wp-content/uploads/2020/11/social-network-4-weeks.title_-779x438.png 779w, /wp-content/uploads/2020/11/social-network-4-weeks.title_.png 1024w" sizes="auto, (max-width: 128px) 100vw, 128px"></a></div><div class="crp-list-item-title"><a href="/2020/11/how-i-built-a-social-network-in-4-weeks-with-graphql-and-serverless/">How I built a social network in 4 weeks with GraphQL and serverless</a></div></div><div class="crp-list-item crp-list-item-image-left crp-list-item-has-image"><div class="crp-list-item-image"><a href="/2024/10/how-to-build-a-leaderboard-service-with-momento/"><img loading="lazy" decoding="async" data-pin-nopin="true" style="max-width: 128px; height: auto;" width="128" height="72" src="/wp-content/uploads/2024/10/momento-leaderboard.title_-300x169.png" class="attachment-128x72 size-128x72 wp-post-image" alt="" srcset="/wp-content/uploads/2024/10/momento-leaderboard.title_-300x169.png 300w, /wp-content/uploads/2024/10/momento-leaderboard.title_-779x438.png 779w, /wp-content/uploads/2024/10/momento-leaderboard.title_.png 1024w" sizes="auto, (max-width: 128px) 100vw, 128px"></a></div><div class="crp-list-item-title"><a href="/2024/10/how-to-build-a-leaderboard-service-with-momento/">How to build a Leaderboard service with Momento: a step-by-step Guide</a></div></div></div>
<div class="a2280-after-content" style="margin-top: 50px; margin-bottom: 50px; " id="a2280-1548551445"><div style="padding: 20px; padding-left: 25px; border-style: solid; border-width: 5px; border-radius: 10px; background-color: #e3f6f5; color: #272343;">
<p><strong style="font-size: 24px;">Whenever you’re ready, here are 3 ways I can help you:</strong></p>
<ol class="unordered_list">
<li style="margin-bottom: 10px;"><a href="https://productionreadyserverless.com/?utm_campaign=3-ways-I-can-help&amp;utm_source=blog&amp;utm_content=text-link" target="_blank" rel="noopener noreferrer"><strong>Production-Ready Serverless</strong></a>: Join 20+ AWS Heroes &amp; Community Builders and 1000+ other students in levelling up your serverless game. This is your one-stop shop for <strong>quickly levelling up your serverless skills</strong>.</li>
<li style="margin-bottom: 10px;">I help clients <strong>launch product ideas</strong>, <strong>improve their development processes</strong> and <strong>upskill their teams</strong>. If you’d like to work together, then let’s <a href="/hire-me/" target="_blank" rel="noopener"><strong>get in touch</strong></a>.</li>
<li style="margin-bottom: 10px;"><a href="https://discord.gg/Ucc9nZBA8H" target="_blank" rel="noopener"><strong>Join my community on Discord</strong></a>, ask questions, and join the discussion on all things AWS and Serverless.</li>
</ol>
</div>
<p><!--more--></p>
</div>
</div><!-- .entry-content .clear -->
</div>
</article><!-- #post-## -->
<nav class="navigation post-navigation" aria-label="Posts">
<h2 class="screen-reader-text">Post navigation</h2>
<div class="nav-links"><div class="nav-previous"><a href="/2019/09/should-you-pack-the-aws-sdk-in-your-deployment-artefact/" rel="prev"><span class="ast-left-arrow">&larr;</span> Previous Post</a></div><div class="nav-next"><a href="/2019/10/the-api-gateway-security-flaw-you-need-to-pay-attention-to/" rel="next">Next Post <span class="ast-right-arrow">&rarr;</span></a></div></div>
</nav>
</main><!-- #main -->
</div><!-- #primary -->
<div itemtype="https://schema.org/WPSideBar" itemscope="itemscope" id="secondary" class="widget-area secondary" role="complementary">
<div class="sidebar-main">
<aside id="block-65" class="widget widget_block"><div style="position: fixed; margin-top: 50px; padding-right: 35px;">
<p style="margin: 0px; font-size: 1.75rem; font-weight: 500;">Become a better AWS developer</p>
<p style="margin: 0px; margin-bottom: -45px;">Join 17k readers and level up your AWS game in just 5 mins a week. Every Monday, I share practical tips, tutorials and best practices for building serverless architectures for the real world.</p>
<script async data-uid="35b71caae2" src="https://theburningmonk.ck.page/35b71caae2/index.js"></script>
<form style="margin-top: 50px; width: 100%; display: flex; align-items: center;" action="https://www.google.com/search" method="get" target="_blank">
<input type="hidden" name="q" id="siteSearch" value="site:theburningmonk.com ">
<input style="width: 80%; max-width: 90%" type="text" placeholder="Search the site..." id="userQuery">
<button type="submit" onclick="updateAction();" style="padding: 10px; border: none; color: white; border-radius: 0 5px 5px 0; cursor: pointer; display: flex; align-items: center; justify-content: center;">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" style="width: 20px; height: 20px;">
<path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z" />
</svg>
</button>
</form>
<script>
function updateAction() {
var baseSearch = "site:theburningmonk.com ";
var userInput = document.getElementById('userQuery').value;
document.getElementById('siteSearch').value = baseSearch + userInput;
}
</script>
</div></aside>
</div><!-- .sidebar-main -->
</div><!-- #secondary -->
</div> <!-- ast-container -->
</div><!-- #content -->
<footer itemtype="https://schema.org/WPFooter" itemscope="itemscope" id="colophon" class="site-footer" role="contentinfo">
<div class="ast-small-footer footer-sml-layout-2">
<div class="ast-footer-overlay">
<div class="ast-container">
<div class="ast-small-footer-wrap" >
<div class="ast-row ast-flex">
<div class="ast-small-footer-section ast-small-footer-section-1 ast-small-footer-section-equally ast-col-md-6 ast-col-xs-12" >
<div class="footer-primary-navigation"><ul id="menu-footermenu" class="nav-menu"><li id="menu-item-12499" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-12499"><a href="/about/">About</a></li>
<li id="menu-item-12500" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-12500"><a href="/subscribe/">Newsletter</a></li>
<li id="menu-item-12501" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-12501"><a target="_blank" href="https://realworldserverless.com">Podcast</a></li>
<li id="menu-item-12505" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-12505"><a href="/speaking-engagements/">Public speaking</a></li>
<li id="menu-item-12932" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-12932"><a href="/sponsorship/">Sponsorship</a></li>
<li id="menu-item-12504" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-12504"><a target="_blank" href="https://medium.com/theburningmonk-com/all-my-posts-on-serverless-aws-lambda-43c17a147f91">Serverless posts</a></li>
<li id="menu-item-12506" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-12506"><a href="/cloudformation-ref-and-getatt-cheatsheet/">CloudFormation cheatsheet</a></li>
</ul></div> </div>
<div class="ast-small-footer-section ast-small-footer-section-2 ast-small-footer-section-equally ast-col-md-6 ast-col-xs-12" >
Copyright © 2026 theburningmonk limited </div>
</div> <!-- .ast-row.ast-flex -->
</div><!-- .ast-small-footer-wrap -->
</div><!-- .ast-container -->
</div><!-- .ast-footer-overlay -->
</div><!-- .ast-small-footer-->
</footer><!-- #colophon -->
</div><!-- #page -->
<script>(function(){var advanced_ads_ga_UID="UA-12216268-1",advanced_ads_ga_anonymIP=!!1;window.advanced_ads_check_adblocker=function(t){var n=[],e=null;function a(t){var n=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){return setTimeout(t,16)};n.call(window,t)}return a((function(){var t=document.createElement("div");t.innerHTML="&nbsp;",t.setAttribute("class","ad_unit ad-unit text-ad text_ad pub_300x250"),t.setAttribute("style","width: 1px !important; height: 1px !important; position: absolute !important; left: 0px !important; top: 0px !important; overflow: hidden !important;"),document.body.appendChild(t),a((function(){var a,o,i=null===(a=(o=window).getComputedStyle)||void 0===a?void 0:a.call(o,t),d=null==i?void 0:i.getPropertyValue("-moz-binding");e=i&&"none"===i.getPropertyValue("display")||"string"==typeof d&&-1!==d.indexOf("about:");for(var c=0,r=n.length;c<r;c++)n[c](e);n=[]}))})),function(t){"undefined"==typeof advanced_ads_adblocker_test&&(e=!0),null!==e?t(e):n.push(t)}}(),(()=>{function t(t){this.UID=t,this.analyticsObject="function"==typeof gtag;var n=this;return this.count=function(){gtag("event","AdBlock",{event_category:"Advanced Ads",event_label:"Yes",non_interaction:!0,send_to:n.UID})},function(){if(!n.analyticsObject){var e=document.createElement("script");e.src="https://www.googletagmanager.com/gtag/js?id="+t,e.async=!0,document.body.appendChild(e),window.dataLayer=window.dataLayer||[],window.gtag=function(){dataLayer.push(arguments)},n.analyticsObject=!0,gtag("js",new Date)}var a={send_page_view:!1,transport_type:"beacon"};window.advanced_ads_ga_anonymIP&&(a.anonymize_ip=!0),gtag("config",t,a)}(),this}advanced_ads_check_adblocker((function(n){n&&new t(advanced_ads_ga_UID).count()}))})();})();</script><script type="speculationrules">
{"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/*"},{"not":{"href_matches":["/wp-*.php","/wp-admin/*","/wp-content/uploads/*","/wp-content/*","/wp-content/plugins/*","/wp-content/themes/astra/*","/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]}
</script>
<script src="https://cdn.usefathom.com/script.js" data-site="ORFHAFTY" defer></script>
<!-- This site is converting visitors into subscribers and customers with OptinMonster - https://optinmonster.com -->
<script>(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.account=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,280271,298131);</script>
<!-- / https://optinmonster.com --><!-- This site is converting visitors into subscribers and customers with OptinMonster - https://optinmonster.com :: Campaign Title: new years 2024 -->
<script>(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,349472,'ceqrmejgxwwo1g9vww2o');</script>
<!-- / OptinMonster --><!-- This site is converting visitors into subscribers and customers with OptinMonster - https://optinmonster.com :: Campaign Title: lambda cold start course -->
<script>(function(d,u,ac){var s=d.createElement('script');s.type='text/javascript';s.src='https://a.omappapi.com/app/js/api.min.js';s.async=true;s.dataset.user=u;s.dataset.campaign=ac;d.getElementsByTagName('head')[0].appendChild(s);})(document,349472,'ruqjlqe5tb9gh5zviazw');</script>
<!-- / OptinMonster --> <script type="text/javascript">
var ceqrmejgxwwo1g9vww2o_shortcode = true;var ruqjlqe5tb9gh5zviazw_shortcode = true; </script>
<script type="text/javascript" id="google_cse_v2-js-extra">
/* <![CDATA[ */
var scriptParams = {"google_search_engine_id":"006830272059582146546:wu5sqrhfjes"};
//# sourceURL=google_cse_v2-js-extra
/* ]]> */
</script>
<script type="text/javascript" src="/wp-content/plugins/wp-google-search/assets/js/google_cse_v2.js?ver=1" id="google_cse_v2-js"></script>
<script type="text/javascript" id="astra-theme-js-js-extra">
/* <![CDATA[ */
var astra = {"break_point":"921","isRtl":""};
//# sourceURL=astra-theme-js-js-extra
/* ]]> */
</script>
<script type="text/javascript" src="/wp-content/themes/astra/assets/js/minified/style.min.js?ver=1.6.2" id="astra-theme-js-js"></script>
<script type="text/javascript" id="convertkit-broadcasts-js-extra">
/* <![CDATA[ */
var convertkit_broadcasts = {"ajax_url":"https://theburningmonk.com/wp-admin/admin-ajax.php","action":"convertkit_broadcasts_render","debug":""};
//# sourceURL=convertkit-broadcasts-js-extra
/* ]]> */
</script>
<script type="text/javascript" src="/wp-content/plugins/convertkit/resources/frontend/js/broadcasts.js?ver=2.5.5" id="convertkit-broadcasts-js"></script>
<script type="text/javascript" id="convertkit-js-js-extra">
/* <![CDATA[ */
var convertkit = {"ajaxurl":"https://theburningmonk.com/wp-admin/admin-ajax.php","debug":"","nonce":"9b34b22409","subscriber_id":""};
//# sourceURL=convertkit-js-js-extra
/* ]]> */
</script>
<script type="text/javascript" src="/wp-content/plugins/convertkit/resources/frontend/js/convertkit.js?ver=2.5.5" id="convertkit-js-js"></script>
<script type="text/javascript" id="stickThis-js-extra">
/* <![CDATA[ */
var sticky_anything_engage = {"element":".main-header-bar-wrap","topspace":"0","minscreenwidth":"651","maxscreenwidth":"999999","zindex":"1","legacymode":"","dynamicmode":"","debugmode":"","pushup":"","adminbar":""};
//# sourceURL=stickThis-js-extra
/* ]]> */
</script>
<script type="text/javascript" src="/wp-content/plugins/sticky-menu-or-anything-on-scroll/assets/js/stickThis.js?ver=2.1.1" id="stickThis-js"></script>
<script>(function(d){var s=d.createElement("script");s.type="text/javascript";s.src="https://a.omappapi.com/app/js/api.min.js";s.async=true;s.id="omapi-script";d.getElementsByTagName("head")[0].appendChild(s);})(document);</script><script type="text/javascript" id="eael-general-js-extra">
/* <![CDATA[ */
var localize = {"ajaxurl":"https://theburningmonk.com/wp-admin/admin-ajax.php","nonce":"da7f9275fa","i18n":{"added":"Added ","compare":"Compare","loading":"Loading..."},"eael_translate_text":{"required_text":"is a required field","invalid_text":"Invalid","billing_text":"Billing","shipping_text":"Shipping","fg_mfp_counter_text":"of"},"page_permalink":"https://theburningmonk.com/2019/10/all-you-need-to-know-about-caching-for-serverless-applications/","cart_redirectition":"","cart_page_url":"","el_breakpoints":{"mobile":{"label":"Mobile Portrait","value":767,"default_value":767,"direction":"max","is_enabled":true},"mobile_extra":{"label":"Mobile Landscape","value":880,"default_value":880,"direction":"max","is_enabled":false},"tablet":{"label":"Tablet Portrait","value":1024,"default_value":1024,"direction":"max","is_enabled":true},"tablet_extra":{"label":"Tablet Landscape","value":1200,"default_value":1200,"direction":"max","is_enabled":false},"laptop":{"label":"Laptop","value":1366,"default_value":1366,"direction":"max","is_enabled":false},"widescreen":{"label":"Widescreen","value":2400,"default_value":2400,"direction":"min","is_enabled":false}},"ParticleThemesData":{"default":"{\"particles\":{\"number\":{\"value\":160,\"density\":{\"enable\":true,\"value_area\":800}},\"color\":{\"value\":\"#ffffff\"},\"shape\":{\"type\":\"circle\",\"stroke\":{\"width\":0,\"color\":\"#000000\"},\"polygon\":{\"nb_sides\":5},\"image\":{\"src\":\"img/github.svg\",\"width\":100,\"height\":100}},\"opacity\":{\"value\":0.5,\"random\":false,\"anim\":{\"enable\":false,\"speed\":1,\"opacity_min\":0.1,\"sync\":false}},\"size\":{\"value\":3,\"random\":true,\"anim\":{\"enable\":false,\"speed\":40,\"size_min\":0.1,\"sync\":false}},\"line_linked\":{\"enable\":true,\"distance\":150,\"color\":\"#ffffff\",\"opacity\":0.4,\"width\":1},\"move\":{\"enable\":true,\"speed\":6,\"direction\":\"none\",\"random\":false,\"straight\":false,\"out_mode\":\"out\",\"bounce\":false,\"attract\":{\"enable\":false,\"rotateX\":600,\"rotateY\":1200}}},\"interactivity\":{\"detect_on\":\"canvas\",\"events\":{\"onhover\":{\"enable\":true,\"mode\":\"repulse\"},\"onclick\":{\"enable\":true,\"mode\":\"push\"},\"resize\":true},\"modes\":{\"grab\":{\"distance\":400,\"line_linked\":{\"opacity\":1}},\"bubble\":{\"distance\":400,\"size\":40,\"duration\":2,\"opacity\":8,\"speed\":3},\"repulse\":{\"distance\":200,\"duration\":0.4},\"push\":{\"particles_nb\":4},\"remove\":{\"particles_nb\":2}}},\"retina_detect\":true}","nasa":"{\"particles\":{\"number\":{\"value\":250,\"density\":{\"enable\":true,\"value_area\":800}},\"color\":{\"value\":\"#ffffff\"},\"shape\":{\"type\":\"circle\",\"stroke\":{\"width\":0,\"color\":\"#000000\"},\"polygon\":{\"nb_sides\":5},\"image\":{\"src\":\"img/github.svg\",\"width\":100,\"height\":100}},\"opacity\":{\"value\":1,\"random\":true,\"anim\":{\"enable\":true,\"speed\":1,\"opacity_min\":0,\"sync\":false}},\"size\":{\"value\":3,\"random\":true,\"anim\":{\"enable\":false,\"speed\":4,\"size_min\":0.3,\"sync\":false}},\"line_linked\":{\"enable\":false,\"distance\":150,\"color\":\"#ffffff\",\"opacity\":0.4,\"width\":1},\"move\":{\"enable\":true,\"speed\":1,\"direction\":\"none\",\"random\":true,\"straight\":false,\"out_mode\":\"out\",\"bounce\":false,\"attract\":{\"enable\":false,\"rotateX\":600,\"rotateY\":600}}},\"interactivity\":{\"detect_on\":\"canvas\",\"events\":{\"onhover\":{\"enable\":true,\"mode\":\"bubble\"},\"onclick\":{\"enable\":true,\"mode\":\"repulse\"},\"resize\":true},\"modes\":{\"grab\":{\"distance\":400,\"line_linked\":{\"opacity\":1}},\"bubble\":{\"distance\":250,\"size\":0,\"duration\":2,\"opacity\":0,\"speed\":3},\"repulse\":{\"distance\":400,\"duration\":0.4},\"push\":{\"particles_nb\":4},\"remove\":{\"particles_nb\":2}}},\"retina_detect\":true}","bubble":"{\"particles\":{\"number\":{\"value\":15,\"density\":{\"enable\":true,\"value_area\":800}},\"color\":{\"value\":\"#1b1e34\"},\"shape\":{\"type\":\"polygon\",\"stroke\":{\"width\":0,\"color\":\"#000\"},\"polygon\":{\"nb_sides\":6},\"image\":{\"src\":\"img/github.svg\",\"width\":100,\"height\":100}},\"opacity\":{\"value\":0.3,\"random\":true,\"anim\":{\"enable\":false,\"speed\":1,\"opacity_min\":0.1,\"sync\":false}},\"size\":{\"value\":50,\"random\":false,\"anim\":{\"enable\":true,\"speed\":10,\"size_min\":40,\"sync\":false}},\"line_linked\":{\"enable\":false,\"distance\":200,\"color\":\"#ffffff\",\"opacity\":1,\"width\":2},\"move\":{\"enable\":true,\"speed\":8,\"direction\":\"none\",\"random\":false,\"straight\":false,\"out_mode\":\"out\",\"bounce\":false,\"attract\":{\"enable\":false,\"rotateX\":600,\"rotateY\":1200}}},\"interactivity\":{\"detect_on\":\"canvas\",\"events\":{\"onhover\":{\"enable\":false,\"mode\":\"grab\"},\"onclick\":{\"enable\":false,\"mode\":\"push\"},\"resize\":true},\"modes\":{\"grab\":{\"distance\":400,\"line_linked\":{\"opacity\":1}},\"bubble\":{\"distance\":400,\"size\":40,\"duration\":2,\"opacity\":8,\"speed\":3},\"repulse\":{\"distance\":200,\"duration\":0.4},\"push\":{\"particles_nb\":4},\"remove\":{\"particles_nb\":2}}},\"retina_detect\":true}","snow":"{\"particles\":{\"number\":{\"value\":450,\"density\":{\"enable\":true,\"value_area\":800}},\"color\":{\"value\":\"#fff\"},\"shape\":{\"type\":\"circle\",\"stroke\":{\"width\":0,\"color\":\"#000000\"},\"polygon\":{\"nb_sides\":5},\"image\":{\"src\":\"img/github.svg\",\"width\":100,\"height\":100}},\"opacity\":{\"value\":0.5,\"random\":true,\"anim\":{\"enable\":false,\"speed\":1,\"opacity_min\":0.1,\"sync\":false}},\"size\":{\"value\":5,\"random\":true,\"anim\":{\"enable\":false,\"speed\":40,\"size_min\":0.1,\"sync\":false}},\"line_linked\":{\"enable\":false,\"distance\":500,\"color\":\"#ffffff\",\"opacity\":0.4,\"width\":2},\"move\":{\"enable\":true,\"speed\":6,\"direction\":\"bottom\",\"random\":false,\"straight\":false,\"out_mode\":\"out\",\"bounce\":false,\"attract\":{\"enable\":false,\"rotateX\":600,\"rotateY\":1200}}},\"interactivity\":{\"detect_on\":\"canvas\",\"events\":{\"onhover\":{\"enable\":true,\"mode\":\"bubble\"},\"onclick\":{\"enable\":true,\"mode\":\"repulse\"},\"resize\":true},\"modes\":{\"grab\":{\"distance\":400,\"line_linked\":{\"opacity\":0.5}},\"bubble\":{\"distance\":400,\"size\":4,\"duration\":0.3,\"opacity\":1,\"speed\":3},\"repulse\":{\"distance\":200,\"duration\":0.4},\"push\":{\"particles_nb\":4},\"remove\":{\"particles_nb\":2}}},\"retina_detect\":true}","nyan_cat":"{\"particles\":{\"number\":{\"value\":150,\"density\":{\"enable\":false,\"value_area\":800}},\"color\":{\"value\":\"#ffffff\"},\"shape\":{\"type\":\"star\",\"stroke\":{\"width\":0,\"color\":\"#000000\"},\"polygon\":{\"nb_sides\":5},\"image\":{\"src\":\"http://wiki.lexisnexis.com/academic/images/f/fb/Itunes_podcast_icon_300.jpg\",\"width\":100,\"height\":100}},\"opacity\":{\"value\":0.5,\"random\":false,\"anim\":{\"enable\":false,\"speed\":1,\"opacity_min\":0.1,\"sync\":false}},\"size\":{\"value\":4,\"random\":true,\"anim\":{\"enable\":false,\"speed\":40,\"size_min\":0.1,\"sync\":false}},\"line_linked\":{\"enable\":false,\"distance\":150,\"color\":\"#ffffff\",\"opacity\":0.4,\"width\":1},\"move\":{\"enable\":true,\"speed\":14,\"direction\":\"left\",\"random\":false,\"straight\":true,\"out_mode\":\"out\",\"bounce\":false,\"attract\":{\"enable\":false,\"rotateX\":600,\"rotateY\":1200}}},\"interactivity\":{\"detect_on\":\"canvas\",\"events\":{\"onhover\":{\"enable\":false,\"mode\":\"grab\"},\"onclick\":{\"enable\":true,\"mode\":\"repulse\"},\"resize\":true},\"modes\":{\"grab\":{\"distance\":200,\"line_linked\":{\"opacity\":1}},\"bubble\":{\"distance\":400,\"size\":40,\"duration\":2,\"opacity\":8,\"speed\":3},\"repulse\":{\"distance\":200,\"duration\":0.4},\"push\":{\"particles_nb\":4},\"remove\":{\"particles_nb\":2}}},\"retina_detect\":true}"},"eael_login_nonce":"42f1a4a59d","eael_register_nonce":"5b8f4ed2a6","eael_lostpassword_nonce":"2d73485199","eael_resetpassword_nonce":"856d741cb8"};
//# sourceURL=eael-general-js-extra
/* ]]> */
</script>
<script type="text/javascript" src="/wp-content/plugins/essential-addons-for-elementor-lite/assets/front-end/js/view/general.min.js?ver=5.8.13" id="eael-general-js"></script>
<script type="text/javascript" id="eucookielaw-scripts-js-extra">
/* <![CDATA[ */
var eucookielaw_data = {"euCookieSet":"","autoBlock":"0","expireTimer":"0","scrollConsent":"0","networkShareURL":"","isCookiePage":"","isRefererWebsite":""};
//# sourceURL=eucookielaw-scripts-js-extra
/* ]]> */
</script>
<script type="text/javascript" src="/wp-content/plugins/eu-cookie-law/js/scripts.js?ver=3.1" id="eucookielaw-scripts-js"></script>
<script type="text/javascript" src="/wp-content/plugins/luckywp-table-of-contents/front/assets/main.min.js?ver=2.1.4" id="lwptoc-main-js"></script>
<script type="text/javascript" src="/wp-content/plugins/optinmonster/assets/dist/js/helper.min.js?ver=2.16.9" id="optinmonster-wp-helper-js"></script>
<script id="wp-emoji-settings" type="application/json">
{"baseUrl":"https://s.w.org/images/core/emoji/17.0.2/72x72/","ext":".png","svgUrl":"https://s.w.org/images/core/emoji/17.0.2/svg/","svgExt":".svg","source":{"concatemoji":"https://theburningmonk.com/wp-includes/js/wp-emoji-release.min.js?ver=6.9.4"}}
</script>
<script type="module">
/* <![CDATA[ */
/*! This file is auto-generated */
const a=JSON.parse(document.getElementById("wp-emoji-settings").textContent),o=(window._wpemojiSettings=a,"wpEmojiSettingsSupports"),s=["flag","emoji"];function i(e){try{var t={supportTests:e,timestamp:(new Date).valueOf()};sessionStorage.setItem(o,JSON.stringify(t))}catch(e){}}function c(e,t,n){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);t=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(n,0,0);const a=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);return t.every((e,t)=>e===a[t])}function p(e,t){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);var n=e.getImageData(16,16,1,1);for(let e=0;e<n.data.length;e++)if(0!==n.data[e])return!1;return!0}function u(e,t,n,a){switch(t){case"flag":return n(e,"\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f","\ud83c\udff3\ufe0f\u200b\u26a7\ufe0f")?!1:!n(e,"\ud83c\udde8\ud83c\uddf6","\ud83c\udde8\u200b\ud83c\uddf6")&&!n(e,"\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f","\ud83c\udff4\u200b\udb40\udc67\u200b\udb40\udc62\u200b\udb40\udc65\u200b\udb40\udc6e\u200b\udb40\udc67\u200b\udb40\udc7f");case"emoji":return!a(e,"\ud83e\u1fac8")}return!1}function f(e,t,n,a){let r;const o=(r="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?new OffscreenCanvas(300,150):document.createElement("canvas")).getContext("2d",{willReadFrequently:!0}),s=(o.textBaseline="top",o.font="600 32px Arial",{});return e.forEach(e=>{s[e]=t(o,e,n,a)}),s}function r(e){var t=document.createElement("script");t.src=e,t.defer=!0,document.head.appendChild(t)}a.supports={everything:!0,everythingExceptFlag:!0},new Promise(t=>{let n=function(){try{var e=JSON.parse(sessionStorage.getItem(o));if("object"==typeof e&&"number"==typeof e.timestamp&&(new Date).valueOf()<e.timestamp+604800&&"object"==typeof e.supportTests)return e.supportTests}catch(e){}return null}();if(!n){if("undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas&&"undefined"!=typeof URL&&URL.createObjectURL&&"undefined"!=typeof Blob)try{var e="postMessage("+f.toString()+"("+[JSON.stringify(s),u.toString(),c.toString(),p.toString()].join(",")+"));",a=new Blob([e],{type:"text/javascript"});const r=new Worker(URL.createObjectURL(a),{name:"wpTestEmojiSupports"});return void(r.onmessage=e=>{i(n=e.data),r.terminate(),t(n)})}catch(e){}i(n=f(s,u,c,p))}t(n)}).then(e=>{for(const n in e)a.supports[n]=e[n],a.supports.everything=a.supports.everything&&a.supports[n],"flag"!==n&&(a.supports.everythingExceptFlag=a.supports.everythingExceptFlag&&a.supports[n]);var t;a.supports.everythingExceptFlag=a.supports.everythingExceptFlag&&!a.supports.flag,a.supports.everything||((t=a.source||{}).concatemoji?r(t.concatemoji):t.wpemoji&&t.twemoji&&(r(t.twemoji),r(t.wpemoji)))});
//# sourceURL=https://theburningmonk.com/wp-includes/js/wp-emoji-loader.min.js
/* ]]> */
</script>
<script>!function(){window.advanced_ads_ready_queue=window.advanced_ads_ready_queue||[],advanced_ads_ready_queue.push=window.advanced_ads_ready;for(var d=0,a=advanced_ads_ready_queue.length;d<a;d++)advanced_ads_ready(advanced_ads_ready_queue[d])}();</script><!-- Eu Cookie Law 3.1 --><div class="pea_cook_wrapper pea_cook_bottomright" style="color:#FFFFFF;background:rgb(0,0,0);background: rgba(0,0,0,0.85);"><p>By continuing to use the site, you agree to the use of cookies. <a style="color:#FFFFFF;" href="#" id="fom">more information</a> <button id="pea_cook_btn" class="pea_cook_btn" href="#">Accept</button></p></div><div class="pea_cook_more_info_popover"><div class="pea_cook_more_info_popover_inner" style="color:#FFFFFF;background-color: rgba(0,0,0,0.9);"><p>The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.</p><p><a style="color:#FFFFFF;" href="#" id="pea_close">Close</a></p></div></div> <script type="text/javascript">var omapi_localized = {
ajax: 'https://theburningmonk.com/wp-admin/admin-ajax.php?optin-monster-ajax-route=1',
nonce: '5efc30f22f',
slugs:
{"ceqrmejgxwwo1g9vww2o":{"slug":"ceqrmejgxwwo1g9vww2o","mailpoet":false},"ruqjlqe5tb9gh5zviazw":{"slug":"ruqjlqe5tb9gh5zviazw","mailpoet":false}} };</script>
<script type="text/javascript">var omapi_data = {"object_id":9252,"object_key":"post","object_type":"post","term_ids":[198,69,237,79,199,3,200,203,174,238,209,202,135,204],"wp_json":"https:\/\/theburningmonk.com\/wp-json","wc_active":false,"edd_active":false,"nonce":"6622b031b0"};</script>
</body>
</html>
<!-- created by Shifter Generator ver.2.5.7 (production) (Jun 23rd 2026, 10:24:04 pm +00:00) (md5:1ee440d582bb8b1749c5f8d2aa3b20b0) --->