CHAPTeR 9 DXP PeRfORMANCe OPTIMIzATION Table 9-1. (continued) Performance Objective Techniques Optimization Rule of Thumb Delivery from edge • for static content, leverage globally • Use content delivery networks locations (nearest distributed edge locations (nearest (CDNs) like Akamai. geographical geographical location) to serve the • Use cloud-based delivery for static location) content with minimal latency. content. • Deliver content from the most optimal geographic location. Compress and • Compression reduces the overall • enable gzip compression at reduce size of request size and the overall the web server layer and set the presentation page size. appropriate HTTP headers for components. • The size of text-based components browser to decompress. such as JavaScript files and CSS • Minify the JavaScripts by removing files reduces after compression. unnecessary and redundant data and stylesheets and plugins. Optimal positioning • Appropriate placement of • Place CSS at top and JavaScripts at of the JavaScripts stylesheets and JavaScripts bottom. and stylesheets improves the perceived page load • Deliver JavaScripts from CDN and times and prevents browsers cloud locations. getting blocked. Other performance • Avoid server redirects. optimization rules • Use custom build of JS frameworks of thumb to include only the needed modules/components. • Remove duplicate HTTP calls. • fix all 404 errors and avoid 301 redirects. • Use HTTP/2, which is the latest version of HTTP. • Use multiple domains to host and deliver static content. (continued) 237
Building Digital Experience Platforms Page 250 Page 252