Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1372262%22%20slang%3D%22en-US%22%3EAzure%20on%20the%20Cheap%20-%20Azure%20Front%20Door%20caching%20vs%20Azure%20CDN%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1372262%22%20slang%3D%22en-US%22%3E%3CP%3EAzure%20on%20the%20Cheap%20posts%20focus%20on%20the%20architecture%2C%20techniques%20and%20technology%20in%20Azure%20that%20add%20considerable%20value%20without%20breaking%20the%20bank.%20This%20value%20is%20being%20measured%20in%20both%20the%20amount%20of%20effort%20taken%20to%20develop%2C%20provision%2C%20and%20maintain%20the%20resources%2C%20as%20well%20as%20the%20monthly%20charge%20for%20the%20resource.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPrevious%20posts%3A%3C%2FP%3E%3CUL%3E%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fazure-developer-community-blog%2Fazure-on-the-cheap-azure-storage-static-website-and-azure-front%2Fba-p%2F1297084%22%20target%3D%22_self%22%3EAzure%20on%20the%20Cheap%20-%20Azure%20Storage%20Static%20Website%20and%20Azure%20Front%20Door%3C%2FA%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId--1330571920%22%20id%3D%22toc-hId--1330571920%22%20id%3D%22toc-hId--1330571920%22%20id%3D%22toc-hId--1330571920%22%3EAzure%20Front%20Door%20caching%20and%20Azure%20CDN%3C%2FH2%3E%3CP%3EThis%20Azure%20on%20the%20Cheap%20post%20takes%20a%20look%20at%20the%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Ffrontdoor%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Front%20Door%3C%2FA%3E%20(AFD)%20caching%20feature%20and%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fcdn%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20CDN%3C%2FA%3E.%20Caching%20static%20website%20content%20is%20a%20common%20technique%20to%20both%20improving%20user%20experience%20as%20well%20as%20reducing%20the%20load%20on%20webservers%20by%20offloading%20the%20delivery%20of%20static%20content%20to%20a%20dedicated%20cache%20service.%20Caching%20services%20like%20Azure%20Front%20Door%20caching%20and%20Azure%20CDN%2C%20are%20optimized%20for%20hosting%20static%20content%20and%20most%20CDN%20services%20are%20globally%20distributed.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20how%20does%20Azure%20Front%20Door%20compare%20with%20Azure%20CDN%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH3%20id%3D%22toc-hId--640010446%22%20id%3D%22toc-hId--640010446%22%20id%3D%22toc-hId--640010446%22%20id%3D%22toc-hId--640010446%22%3EAzure%20Front%20Door%3C%2FH3%3E%3CP%3EAzure%20Front%20Door%20provides%20a%20caching%20feature%20that%20is%20literally%20at%20a%20click%20of%20a%20button%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-11%2010_00_21-Update%20routing%20rule%20-%20Microsoft%20Azure.jpg%22%20style%3D%22width%3A%20181px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F190468i1A03A5692EE2B612%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%222020-05-11%2010_00_21-Update%20routing%20rule%20-%20Microsoft%20Azure.jpg%22%20alt%3D%222020-05-11%2010_00_21-Update%20routing%20rule%20-%20Microsoft%20Azure.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAzure%20Front%20Door%20does%20support%20some%20configuration%20of%20how%20caching%20is%20handled.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-15%2013_55_02-Update%20routing%20rule%20-%20Microsoft%20Azure.jpg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F191937i2F3CF978E692B4E7%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%222020-05-15%2013_55_02-Update%20routing%20rule%20-%20Microsoft%20Azure.jpg%22%20alt%3D%222020-05-15%2013_55_02-Update%20routing%20rule%20-%20Microsoft%20Azure.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EMost%20common%20requirements%20are%20supported%20including%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fannouncing-azure-front-door-rules-engine-in-preview%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Esupport%20for%20a%20Rules%20Engine%3C%2FA%3E.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH3%20id%3D%22toc-hId-1847502387%22%20id%3D%22toc-hId-1847502387%22%20id%3D%22toc-hId-1847502387%22%20id%3D%22toc-hId-1847502387%22%3EAzure%20CDN%3C%2FH3%3E%3CP%3EAzure%20CDN%20is%20also%20a%20feature%20that%20can%20easily%20be%20enabled%20in%20an%20Azure%20Storage.%20For%20example%2C%20in%20the%20Blob%20service%20menu%2C%20the%20Azure%20CDN%20option%20is%20available.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-15%2013_44_52-cheapstorageuk%20-%20Microsoft%20Azure.jpg%22%20style%3D%22width%3A%20230px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F191935i24D9FD690CFD734F%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%222020-05-15%2013_44_52-cheapstorageuk%20-%20Microsoft%20Azure.jpg%22%20alt%3D%222020-05-15%2013_44_52-cheapstorageuk%20-%20Microsoft%20Azure.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThis%20requires%20a%20new%20endpoint%20to%20be%20created.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-15%2013_47_01-cheapstorageuk%20_%20Azure%20CDN%20-%20Microsoft%20Azure.jpg%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F191936iD57329985910BCE2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%222020-05-15%2013_47_01-cheapstorageuk%20_%20Azure%20CDN%20-%20Microsoft%20Azure.jpg%22%20alt%3D%222020-05-15%2013_47_01-cheapstorageuk%20_%20Azure%20CDN%20-%20Microsoft%20Azure.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EOnce%20the%20CDN%20endpoint%20is%20created%2C%20you%20can%20control%20aspects%20of%20the%20CDN%20such%20as%20the%20blob%20container%20Origin%20path%2C%20supported%20protocols%2C%20caching%20rules%2C%20and%20other%20optimizations.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20post%20illustrates%20how%20website%20caching%20can%20help%20the%20performance%20of%20the%20Azure%20On%20The%20Cheap%20website.%20In%20the%20previous%20post%20we%20illustrated%20how%20using%20Azure%20Front%20Door%20improves%20performance%20by%20directing%20global%20traffic%20to%20Azure%20Storage%20near%20the%20user.%20We%20will%20attempt%20to%20improve%20performance%20by%20using%20the%20Azure%20Front%20Door%20caching%20feature.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CDIV%3ENote%3A%20This%20is%20not%20an%20exhaustive%20comparison.%20It%20is%20encouraged%20that%20you%20conduct%20your%20own%20investigation%20as%20each%20solution%20has%20a%20different%20mix%20of%20requirements.%3C%2FDIV%3E%3CH3%20id%3D%22toc-hId-40047924%22%20id%3D%22toc-hId-40047924%22%20id%3D%22toc-hId-40047924%22%20id%3D%22toc-hId-40047924%22%3EScenario%3C%2FH3%3E%3CP%3EThis%20post%20builds%20upon%20the%20previous%20post's%20example%20by%20introducing%20a%20dynamic%20component%3A%20Azure%20Functions.%20In%20this%20example%2C%20AFD%20distributes%20a%20static%20website%20globally.%20The%20website%20is%20composed%20of%20a%20landing%20page%20containing%20a%20searchable%20table%20and%20three%20galleries.%20The%20landing%20page%20is%20built%20with%20%3CA%20href%3D%22https%3A%2F%2Fdatatables.net%2F%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EDataTables.net%3C%2FA%3E%20and%20sourced%20from%20an%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Ffunctions%2F%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Function%3C%2FA%3E.%26nbsp%3BThe%20purpose%20was%20to%20combine%20static%20and%20dynamic%20content.%26nbsp%3BAn%20important%20thing%20to%20note%20is%20the%20url%20of%20the%20Azure%20Function%20is%20contained%20in%20a%20javascript%20file.%20To%20solve%20this%2C%20%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F53870.github-actions-azure-functions.aspx%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ean%20additional%20step%20in%20the%20GitHub%20Actions%3C%2FA%3E%20to%20determine%20the%20correct%20file%20when%20deploying%20to%20the%20regional%20storage%20location.%20This%20is%20not%20optimal%20and%20a%20bit%20ugly.%26nbsp%3BIn%20a%20future%20post%20we%20will%20explore%20how%20to%20clean%20this%20up.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20three%20galleries%20contain%20the%20same%20content%20but%20the%20images%20are%20referenced%20differently%3A%3C%2FP%3E%3CUL%3E%3CLI%3EThe%20first%20gallery%20uses%20local%20files%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-11%2010_31_17-Azure%20On%20The%20Cheap!.jpg%22%20style%3D%22width%3A%20605px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F190471iB146FAB0973B349B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-11%2010_31_17-Azure%20On%20The%20Cheap!.jpg%22%20alt%3D%222020-05-11%2010_31_17-Azure%20On%20The%20Cheap!.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3EThe%20second%20uses%20files%20sourced%20from%20Azure%20storage%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-11%2010_31_39-Azure%20On%20The%20Cheap!.jpg%22%20style%3D%22width%3A%20872px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F190472i637526A59C8B093F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-11%2010_31_39-Azure%20On%20The%20Cheap!.jpg%22%20alt%3D%222020-05-11%2010_31_39-Azure%20On%20The%20Cheap!.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%3CLI%3EThe%20third%20uses%20files%20sourced%20from%20Azure%20CDN%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-11%2010_30_44-Azure%20On%20The%20Cheap!.jpg%22%20style%3D%22width%3A%20787px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F190473i8DAE3E683BC0ACC9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-11%2010_30_44-Azure%20On%20The%20Cheap!.jpg%22%20alt%3D%222020-05-11%2010_30_44-Azure%20On%20The%20Cheap!.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FLI%3E%3C%2FUL%3E%3CP%3EThe%20images%20range%20from%2011kb%20to%2077kb%20in%20size.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20following%20illustrates%20the%20new%20project%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-08%2011_24_18-Architecture.vsdx%20-%20Visio%20Professional.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F189947iDC6CA482ECB32F10%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-08%2011_24_18-Architecture.vsdx%20-%20Visio%20Professional.jpg%22%20alt%3D%222020-05-08%2011_24_18-Architecture.vsdx%20-%20Visio%20Professional.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAzure%20Front%20Door%20is%20used%20to%20route%20traffic%20to%20a%20storage%20account%20in%20the%20closest%20region%20to%20the%20user.%20The%20static%20website%20contains%20a%20grid%20that%20uses%20retrieves%20data%20from%20an%20Azure%20Function%20running%20in%20the%20same%20region.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH3%20id%3D%22toc-hId--1767406539%22%20id%3D%22toc-hId--1767406539%22%20id%3D%22toc-hId--1767406539%22%20id%3D%22toc-hId--1767406539%22%3EJMeter%3C%2FH3%3E%3CP%3EOur%20favorite%20load%20testing%20tool%20is%20being%20used%20again%2C%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdevops%2Ftest%2Fload-test%2Foverview%3Fview%3Dazure-devops%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20DevOps%20Load%20Testing%3C%2FA%3E.%20Please%20see%20this%20%3CA%20href%3D%22https%3A%2F%2Fsocial.technet.microsoft.com%2Fwiki%2Fcontents%2Farticles%2F53875.getting-started-with-azure-devops-jmeter-load-tests.aspx%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ewiki%20article%3C%2FA%3E%20on%20getting%20started.%20Unfortunately%2C%20it%20is%20just%20a%20matter%20of%20time%20before%20this%20DevOps%20feature%20is%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdevops%2Ftest%2Fload-test%2Foverview%3Fview%3Dazure-devops%23timeframe%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eno%20longer%20available%3C%2FA%3E.%20Until%20then%20we%20will%20continue%20to%20use%20it.%20%3CEM%3EPlease%20comment%20if%20you%20have%20a%20cheap%20alternative!%3C%2FEM%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20JMeter%20test%20was%20written%20to%20perform%20the%20following%3A%3C%2FP%3E%3CUL%3E%3CLI%3ENavigate%20to%20the%20landing%20page%3C%2FLI%3E%3CLI%3EMake%20an%20API%20call%20to%20the%20Azure%20Function%3C%2FLI%3E%3CLI%3ENavigate%20to%20the%20gallery%20containing%20references%20to%20locally%20held%20images%3C%2FLI%3E%3CLI%3ENavigate%20to%20the%20gallery%20containing%20references%20to%20images%20stored%20in%20the%20same%20blob%20storage%3C%2FLI%3E%3CLI%3ENavigate%20to%20the%20gallery%20containing%20references%20to%20images%20from%20Azure%20CDN%3C%2FLI%3E%3C%2FUL%3E%3CP%3EThe%20JMeter%20test%20was%20issued%20against%20a%20single%20datacenter%20to%20gauge%20the%20performance%20of%20the%20website%20with%20and%20without%20Azure%20Front%20Door%20caching%20enabled.%20The%20expectation%20would%20be%20without%20AFD%20caching%20the%20Azure%20CDN%20will%20be%20much%20faster%20as%20these%20should%20be%20sourced%20close.%20We%20also%20anticipate%20that%20the%20performance%20of%20the%20images%20sourced%20local%20to%20the%20static%20pages%20and%20the%20images%20sourced%20from%20storage%20should%20be%20relatively%20the%20same.%20This%20is%20because%20they%20are%20both%20being%20retrieved%20from%20the%20same%20blob%20storage%20account.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH4%20id%3D%22toc-hId--1076845065%22%20id%3D%22toc-hId--1076845065%22%20id%3D%22toc-hId--1076845065%22%20id%3D%22toc-hId--1076845065%22%3EWithout%20Azure%20Front%20Door%20caching%20enabled%3C%2FH4%3E%3CP%3EWithout%20caching%20enabled%20we%20can%20see%20a%20clear%20distinction%20between%20the%20images%20delivered%20from%20Azure%20CDN%20and%20the%20ones%20delivered%20from%20the%20storage%20account.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-18%2014_32_08-Book1%20-%20Excel.jpg%22%20style%3D%22width%3A%20786px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192411i085848F1B0126138%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-18%2014_32_08-Book1%20-%20Excel.jpg%22%20alt%3D%222020-05-18%2014_32_08-Book1%20-%20Excel.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20is%20interesting%20is%20a%20performance%20difference%20between%20the%20images%20delivered%20from%20storage.%20The%20same%20file%20is%20sourced%20from%20the%20same%20Azure%20Storage%20blob%20account%20but%20one%20the%20Local%20Gallery%20is%20via%20AFD.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20test%20was%20then%20modified%20to%20introduce%20a%20new%20test%20that%20retrieved%20the%20files%20directly%20from%20storage%20and%20not%20through%20AFD.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-18%2015_19_43-Book1%20-%20Excel.jpg%22%20style%3D%22width%3A%20780px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192417i1B7B459BFA9776A5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-18%2015_19_43-Book1%20-%20Excel.jpg%22%20alt%3D%222020-05-18%2015_19_43-Book1%20-%20Excel.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20images%20retrieved%20through%20AFD%20do%20get%20a%20performance%20improvement%20just%20by%20using%20AFD.%20Nice.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH4%20id%3D%22toc-hId-1410667768%22%20id%3D%22toc-hId-1410667768%22%20id%3D%22toc-hId-1410667768%22%20id%3D%22toc-hId-1410667768%22%3EWith%20Azure%20Front%20Door%20caching%20enabled%3C%2FH4%3E%3CP%3EBut%20how%20does%20AFD%20with%20caching%20compare%20to%20Azure%20CDN%3F%20With%20AFD%20caching%20enabled%2C%20the%20same%20test%20is%20performed.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-18%2014_34_25-Book1%20-%20Excel.jpg%22%20style%3D%22width%3A%20783px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192412i8EC56BEA5653EB17%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-18%2014_34_25-Book1%20-%20Excel.jpg%22%20alt%3D%222020-05-18%2014_34_25-Book1%20-%20Excel.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EBoth%20the%20images%20and%20the%20landing%20page%20received%20a%20healthy%20performance%20improvement%20with%20caching%20enabled.%20Though%20not%20a%20comprehensive%20test%2C%20the%20performance%20between%20Azure%20CDN%20and%20the%20AFD%20cache%20appear%20comparable.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAn%20interesting%20thing%20to%20note%20is%20when%20looking%20at%20the%20AFD%20metrics%2C%20we%20can%20see%20the%20point%20when%20caching%20was%20enabled.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-08%2011_21_36-Metrics%20-%20Microsoft%20Azure.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192424iD058E3E90B173B8D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-08%2011_21_36-Metrics%20-%20Microsoft%20Azure.jpg%22%20alt%3D%222020-05-08%2011_21_36-Metrics%20-%20Microsoft%20Azure.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThis%20illustrates%20how%20using%20AFD%20with%20caching%20could%20be%20valuable%20in%20scenarios%20where%20content%20is%20being%20delivered%20from%20a%20webserver.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId--1097851273%22%20id%3D%22toc-hId--1097851273%22%20id%3D%22toc-hId--1097851273%22%20id%3D%22toc-hId--1097851273%22%3ECost%3C%2FH2%3E%3CP%3ESo%20how%20does%20AFD%20with%20caching%20enabled%20and%20Azure%20CDN%20compare%20on%20cost%3F%20Comparing%20the%20cost%20of%20these%20two%20services%20is%20not%20really%20straight%20forward.%20AFD%20caching%20is%20a%20great%20feature%20and%20in%20many%20circumstances%20the%20simplicity%20of%20enabling%20this%20does%20makes%20sense.%20Once%20you%20begin%20adding%20additional%20features%20of%20Azure%20CDN%20like%20Rules%2C%20AFD%20does%20become%20more%20expensive%20as%20these%20are%20charged%20per%20ruleset.%20Comparing%20outbound%20data%20transfer%20pricing%2C%20Azure%20CDN%20is%20more%20cost%20effective.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-19%2009_53_48-Pricing%20-%20Content%20Delivery%20Network%20(CDN)%20_%20Microsoft%20Azure.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192863i17F53F37B6E1F9CE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-19%2009_53_48-Pricing%20-%20Content%20Delivery%20Network%20(CDN)%20_%20Microsoft%20Azure.jpg%22%20alt%3D%222020-05-19%2009_53_48-Pricing%20-%20Content%20Delivery%20Network%20(CDN)%20_%20Microsoft%20Azure.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAzure%20Front%20Door%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-19%2009_54_13-Pricing%20-%20Front%20Door%20_%20Microsoft%20Azure.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F192862i57AC29D83B88EF5C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-19%2009_54_13-Pricing%20-%20Front%20Door%20_%20Microsoft%20Azure.jpg%22%20alt%3D%222020-05-19%2009_54_13-Pricing%20-%20Front%20Door%20_%20Microsoft%20Azure.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20general%2C%20if%20your%20goal%20is%20to%20use%20AFD%20as%20a%20content%20delivery%20network%2C%20then%20Azure%20CDN%20makes%20more%20sense.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CH2%20id%3D%22toc-hId-1389661560%22%20id%3D%22toc-hId-1389661560%22%20id%3D%22toc-hId-1389661560%22%20id%3D%22toc-hId-1389661560%22%3ESummary%3C%2FH2%3E%3CP%3EThough%20not%20an%20exhaustive%20comparison%2C%20this%20was%20a%20very%20useful%20exercise%20in%20exploring%20both%20Azure%20Front%20Door%20and%20Azure%20CDN.%20There%20are%20many%20ways%20of%20putting%20together%20cloud%20services%20and%20it%20is%20often%20not%20clear%20which%20combination%20is%20optimal.%20AFD%20is%20not%20a%20CDN%20but%20is%20much%20more.%20AFD%20can%20provide%20similar%20functionality%20but%20Azure%20CDN%20does%20just%20as%20good%20of%20a%20job%20at%20content%20delivery%20at%20a%20cheaper%20price!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHopefully%20this%20series%20is%20useful%20(like%20if%20it%20is).%20As%20the%20solution%20includes%20additional%20functionality%2C%20we%20will%20continue%20to%20evolve%20the%20solution.%20Based%20on%20the%20findings%20in%20this%20post%20the%20next%20step%20is%20to%20change%20our%20static%20website%20to%20be%20delivered%20from%20Azure%20CDN%20and%20use%20AFD%20or%20Traffic%20Manager%20to%20route%20requests%20to%20the%20Azure%20Functions.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1372262%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-05-08%2011_24_18-Architecture.vsdx%20-%20Visio%20Professional.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F189947iDC6CA482ECB32F10%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222020-05-08%2011_24_18-Architecture.vsdx%20-%20Visio%20Professional.jpg%22%20alt%3D%222020-05-08%2011_24_18-Architecture.vsdx%20-%20Visio%20Professional.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EAzure%20on%20the%20Cheap%20posts%20focus%20on%20the%20architecture%2C%20techniques%20and%20technology%20in%20Azure%20that%20add%20considerable%20value%20without%20breaking%20the%20bank.%20This%20value%20is%20being%20measured%20in%20both%20the%20amount%20of%20effort%20taken%20to%20develop%2C%20provision%2C%20and%20maintain%20the%20resources%2C%20as%20well%20as%20the%20monthly%20charge%20for%20the%20resource.%26nbsp%3BThis%20Azure%20on%20the%20Cheap%20post%20takes%20a%20look%20at%20Azure%20CDN%20and%20the%20Azure%20Front%20Door%20caching%20feature.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1408248%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20on%20the%20Cheap%20-%20Azure%20Front%20Door%20caching%20vs%20Azure%20CDN%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1408248%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F141713%22%20target%3D%22_blank%22%3E%40Jeffrey%20Chilberto%3C%2FA%3E%26nbsp%3BNice%20comparison!%20Worthwhile%20to%20mention%20that%20one%20interesting%20feature%20offered%20by%20Azure%20CDN%20Verizon%20Premium%20only%2C%20is%20%3CSTRONG%3EToken%20Authentication%3C%2FSTRONG%3E%20which%20prevents%20%3CA%20href%3D%22https%3A%2F%2Fsimple.wikipedia.org%2Fwiki%2FHotlinking%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehotlinking%3C%2FA%3E%2C%20thus%20a%20risk%20of%20increased%20costs.%20I%20already%20had%20customers%20explicitly%20asking%20for%20this%20and%20for%20the%20time%20being%2C%20only%20Verizon%20Premium%20does%20offer%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Azure on the Cheap posts focus on the architecture, techniques and technology in Azure that add considerable value without breaking the bank. This value is being measured in both the amount of effort taken to develop, provision, and maintain the resources, as well as the monthly charge for the resource. 

 

Previous posts:

 

Azure Front Door caching and Azure CDN

This Azure on the Cheap post takes a look at the Azure Front Door (AFD) caching feature and Azure CDN. Caching static website content is a common technique to both improving user experience as well as reducing the load on webservers by offloading the delivery of static content to a dedicated cache service. Caching services like Azure Front Door caching and Azure CDN, are optimized for hosting static content and most CDN services are globally distributed.

 

But how does Azure Front Door compare with Azure CDN?

 

Azure Front Door

Azure Front Door provides a caching feature that is literally at a click of a button:

2020-05-11 10_00_21-Update routing rule - Microsoft Azure.jpg

Azure Front Door does support some configuration of how caching is handled.

2020-05-15 13_55_02-Update routing rule - Microsoft Azure.jpg

Most common requirements are supported including support for a Rules Engine.

 

Azure CDN

Azure CDN is also a feature that can easily be enabled in an Azure Storage. For example, in the Blob service menu, the Azure CDN option is available.

2020-05-15 13_44_52-cheapstorageuk - Microsoft Azure.jpg

This requires a new endpoint to be created.

2020-05-15 13_47_01-cheapstorageuk _ Azure CDN - Microsoft Azure.jpg

Once the CDN endpoint is created, you can control aspects of the CDN such as the blob container Origin path, supported protocols, caching rules, and other optimizations.

 

This post illustrates how website caching can help the performance of the Azure On The Cheap website. In the previous post we illustrated how using Azure Front Door improves performance by directing global traffic to Azure Storage near the user. We will attempt to improve performance by using the Azure Front Door caching feature. 

 

Note: This is not an exhaustive comparison. It is encouraged that you conduct your own investigation as each solution has a different mix of requirements.

Scenario

This post builds upon the previous post's example by introducing a dynamic component: Azure Functions. In this example, AFD distributes a static website globally. The website is composed of a landing page containing a searchable table and three galleries. The landing page is built with DataTables.net and sourced from an Azure Function. The purpose was to combine static and dynamic content. An important thing to note is the url of the Azure Function is contained in a javascript file. To solve this, an additional step in the GitHub Actions to determine the correct file when deploying to the regional storage location. This is not optimal and a bit ugly. In a future post we will explore how to clean this up.

 

The three galleries contain the same content but the images are referenced differently:

  • The first gallery uses local files
    2020-05-11 10_31_17-Azure On The Cheap!.jpg
  • The second uses files sourced from Azure storage
    2020-05-11 10_31_39-Azure On The Cheap!.jpg
  • The third uses files sourced from Azure CDN
    2020-05-11 10_30_44-Azure On The Cheap!.jpg

The images range from 11kb to 77kb in size.

 

The following illustrates the new project:

2020-05-08 11_24_18-Architecture.vsdx - Visio Professional.jpg

Azure Front Door is used to route traffic to a storage account in the closest region to the user. The static website contains a grid that uses retrieves data from an Azure Function running in the same region. 

 

JMeter

Our favorite load testing tool is being used again, Azure DevOps Load Testing. Please see this wiki article on getting started. Unfortunately, it is just a matter of time before this DevOps feature is no longer available. Until then we will continue to use it. Please comment if you have a cheap alternative!

 

The JMeter test was written to perform the following:

  • Navigate to the landing page
  • Make an API call to the Azure Function
  • Navigate to the gallery containing references to locally held images
  • Navigate to the gallery containing references to images stored in the same blob storage
  • Navigate to the gallery containing references to images from Azure CDN

The JMeter test was issued against a single datacenter to gauge the performance of the website with and without Azure Front Door caching enabled. The expectation would be without AFD caching the Azure CDN will be much faster as these should be sourced close. We also anticipate that the performance of the images sourced local to the static pages and the images sourced from storage should be relatively the same. This is because they are both being retrieved from the same blob storage account.

 

Without Azure Front Door caching enabled

Without caching enabled we can see a clear distinction between the images delivered from Azure CDN and the ones delivered from the storage account.

 

2020-05-18 14_32_08-Book1 - Excel.jpg

 

What is interesting is a performance difference between the images delivered from storage. The same file is sourced from the same Azure Storage blob account but one the Local Gallery is via AFD.

 

The test was then modified to introduce a new test that retrieved the files directly from storage and not through AFD.

2020-05-18 15_19_43-Book1 - Excel.jpg

The images retrieved through AFD do get a performance improvement just by using AFD. Nice.

 

With Azure Front Door caching enabled

But how does AFD with caching compare to Azure CDN? With AFD caching enabled, the same test is performed.

2020-05-18 14_34_25-Book1 - Excel.jpg

Both the images and the landing page received a healthy performance improvement with caching enabled. Though not a comprehensive test, the performance between Azure CDN and the AFD cache appear comparable. 

 

An interesting thing to note is when looking at the AFD metrics, we can see the point when caching was enabled.

2020-05-08 11_21_36-Metrics - Microsoft Azure.jpg

This illustrates how using AFD with caching could be valuable in scenarios where content is being delivered from a webserver. 

 

Cost

So how does AFD with caching enabled and Azure CDN compare on cost? Comparing the cost of these two services is not really straight forward. AFD caching is a great feature and in many circumstances the simplicity of enabling this does makes sense. Once you begin adding additional features of Azure CDN like Rules, AFD does become more expensive as these are charged per ruleset. Comparing outbound data transfer pricing, Azure CDN is more cost effective.


2020-05-19 09_53_48-Pricing - Content Delivery Network (CDN) _ Microsoft Azure.jpg

Azure Front Door

2020-05-19 09_54_13-Pricing - Front Door _ Microsoft Azure.jpg

 

In general, if your goal is to use AFD as a content delivery network, then Azure CDN makes more sense.

 

Summary

Though not an exhaustive comparison, this was a very useful exercise in exploring both Azure Front Door and Azure CDN. There are many ways of putting together cloud services and it is often not clear which combination is optimal. AFD is not a CDN but is much more. AFD can provide similar functionality but Azure CDN does just as good of a job at content delivery at a cheaper price!

 

Hopefully this series is useful (like if it is). As the solution includes additional functionality, we will continue to evolve the solution. Based on the findings in this post the next step is to change our static website to be delivered from Azure CDN and use AFD or Traffic Manager to route requests to the Azure Functions.

1 Comment

@Jeffrey Chilberto Nice comparison! Worthwhile to mention that one interesting feature offered by Azure CDN Verizon Premium only, is Token Authentication which prevents hotlinking, thus a risk of increased costs. I already had customers explicitly asking for this and for the time being, only Verizon Premium does offer it.