Dig, also known as Dig Inn, is a large chain of fast casual restaurants focusing on cooked-to-order, plant-based foods, sustainability, and working directly with farmers and partners to plan mindful recipes. It has nearly 50 locations, most of them in urban business districts, and serves six million customers each year.
Dig did a significant amount of business online even prior to COVID-19. After the pandemic began, online ordering spiked further. To ensure they had the scalability to meet this increased demand, Dig asked Happy Cog, a full-service interactive agency and its long-time partner, to develop two new websites. One would contain an online ordering portal for customers, and the other would be an informational site where customers could learn more about Dig.
Both websites needed to be secure, fast, and easy for Dig’s customers to use. The ordering site needed to seamlessly scale during peak times, when traffic increases rapidly.
“Uptime is a big priority for Dig,” explains Matt Weinberg, President of Technology at Happy Cog. “During the lunch and dinner rushes, Dig’s restaurants are incredibly busy. Because restaurant profit margins are razor-thin, even five minutes of downtime during lunch can have a material impact.”
Happy Cog decided to build Dig’s websites using Cloudflare Pages, which allows developers to deploy and host their sites directly to the edge, closer to end users. Pages is a Jamstack-compatible platform that further simplifies the developer experience with full Git-integration, advanced collaboration with unlimited free seats for collaborators, automatic previews for every PR and commit, and more.
“Cloudflare Pages is very cost-effective, and it’s very easy to deploy code,” Weinberg explains. “Additionally, Pages offers additional value through integration with Cloudflare’s performance and security tools, such as the CDN and WAF, making it the perfect solution for this.”
Dig’s online ordering site is a headless React application that is entirely hosted on Cloudflare Pages. Javascript calls an underlying API to get and handle dynamic ordering logic. The developers at Happy Cog use Github Actions to build/deploy this to Cloudflare Pages when commits are approved and merged to master.
Workers ensures that React routing happens properly. “Because this all runs on Workers, we never have to worry about a large spike in traffic or orders bringing down the system and causing a revenue loss,” Weinberg notes.
The informational site, meanwhile, is a content management system (CMS) based site integrated with the Cloudflare Cache Break API. While the assets are stored on S3, they also go through Cloudflare to take advantage of Cloudflare CDN caching and Cloudflare Polish image compression.