January 14, 2020

Sitemap and Page Cache = SEO

Jesse Bethke @JesseBethke

I've decided that I really want a January 1st go live with the product data. Even though we are no-where near ready for checkouts, getting those product pages up and getting google indexing it is essential for long-term SEO.

I started by preparing lambda routines that would nightly prepare sitemaps for all the product data. Putting all the products into one sitemap would be too huge. It's also too much to process at once. So I organized the sitemaps by product category. Each category is processed one at a time, in-sequence for their products. A sitemap index identifies each.

Next was the AMP compliant static page cache. Angular pages are not very search engine crawler friendly. This is because they are javascript heavy and rendered client side. I needed to be able to serve up a static version of each page, in under 50ms, so that the crawler can index it.

I prepared a lambda routine that would conduct a server-side render of the page and write the HTML to S3. I also updated the CloudFront distribution as such that it would route inbound request for any product page to the respective cached page in S3. The pages include structured JSON+LD data and a bootstrap to load the angular PWA app. The end result, a fully functional site for users with javascript disabled. To keep the pages up-to-date, I registered an on-update data stream from Dynamo back into Lambda to asynchrously re-render the pages. Any source that updates the product data will result in an updated page cache.

Loading comments...