Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Does it make sense to use Cloud CDN vs Cloud Storage for reducing cost by caching static content?

Hello, Google Cloud Community !

I am seeking advice on whether it is more cost-effective to use Google Cloud CDN instead of just a Google Cloud Storage bucket for serving static content, particularly images.

In my project, I initially used only a Google Cloud Storage bucket to serve images (Those images are public on the Bucket).

However, I recently switched to using Cloud CDN to try reducing costs when serving static content (images).

I set up a 'Global external Application Load Balancer' with an SSL certificate managed by Google and a 'Backend Bucket' with Cloud CDN enabled. This setup is integrated with the load balancer through an https_proxy rule that directs requests to the backend bucket serving the images.

Additionally, I recently have customized the CDN settings to always respond with the header 'cache-control: public, max-age=31536000'. My intention is to cache static images (which never change) in the user's browser for as long as possible, to avoid repeated requests to the CDN.

However, I've noticed that the cost associated with cache egress, specifically the 'Networking Cloud CDN Traffic Cache Data Transfer to {Region}' metric, is exceeding the costs I previously incurred for object downloads using only Google Cloud Storage.

I'm wondering if there's something wrong with my architecture or configuration.

One of the bases for this decision was that in the region where my application is most requested, the CDN cost with 'Cache data transfer out' / 'Cache Egress' is lower than the 'Worldwide Download' price for the bucket in Google Cloud Storage.

(CDN Cache Data Transfer Out: $0.09 / GB) - For the region my application is most requested
(Google Cloud Storage Multi-Region - Data transfer to Worldwide Destinations: $0.12 / GB)

Could anyone provide insights or suggestions on whether my current approach is cost-effective, or if there are better alternatives?

Thank you for your assistance.

12 4 8,971