Speeding Up Your Private Google Cloud Storage with Akamai CDN and HMAC Keys

Venkatesh R
Niveus Solutions
2 min readMay 27, 2024

--

Ever uploaded a private bucket to Google Cloud Storage (GCS) and worried about slow loading times for your users around the world? A Content Delivery Network (CDN) can be your savior! In this post, we’ll explore how to leverage Akamai’s powerful CDN alongside HMAC keys to securely deliver content from your private GCS bucket, including a default index.html and error pages (error.html). We’ll also keep things easy to understand.

What’s a CDN?

Imagine your website’s files live in a single data center. When a user from India tries to access them, the data has to travel a long distance, causing delays. A CDN solves this by creating geographically distributed servers — like having copies of your files closer to your users. This significantly reduces load times and improves user experience.

Why Akamai?

Akamai is a leading CDN provider known for its vast global network and robust security features. It’s a perfect fit for serving content from your private GCS bucket.

HMAC Keys: The Secure Gatekeeper

While a CDN offers speed, you still want to control access to your private GCS bucket. Here’s where HMAC (Hash-based Message Authentication Code) keys come in. These act like secret handshakes that grant Akamai’s servers temporary access to your bucket, ensuring only authorized requests get through.

Setting it Up: Akamai + HMAC Keys + GCS

Here’s a simplified breakdown of the configuration process:

  1. Provision Akamai: Sign up for Akamai’s CDN services and configure your desired delivery behavior.
  2. Create HMAC Keys: Within the Google Cloud Console, generate HMAC keys for your GCS bucket. These will be used by Akamai to authenticate requests.
  3. Configure Akamai with HMAC Keys: Provide Akamai with the generated HMAC keys. This allows their servers to access your private bucket securely.
  4. Upload Default Files (index.html & error.html): Upload your default index.html (the main page users see) and error pages (error.html) to your GCS bucket.
  5. Configure Origin: In your Akamai configuration, set your private GCS bucket as the origin server for content delivery.

Remember: Refer to Akamai’s documentation for detailed configuration steps specific to their platform. The provided reference article HMAC Key setup and CDN Best Practices offers valuable insights as well.

Benefits of this Setup:

  • Faster Load Times: Akamai’s global network ensures content is served from servers closest to users, leading to significant speed improvements.
  • Enhanced Security: HMAC keys provide an extra layer of protection for your private GCS bucket, restricting unauthorized access.
  • Improved Scalability: Akamai’s robust infrastructure can handle traffic spikes easily, ensuring your website remains available during high demand periods.

By combining Akamai’s CDN with HMAC keys, you can securely deliver content from your private GCS bucket at blazing-fast speeds, offering a seamless experience for your global audience.

--

--

Venkatesh R
Niveus Solutions

Solution Architect | AWS - Azure - GCP | Terraform | DevOps | IAAS | Database & Caching | WCS |Mangement | 📃🎙️Creative Write