In Google Cloud Platform, a backend bucket is used with a load balancer to serve static content. What happens when a user requests a file that does not exist in the backend bucket?
Think about what happens when a file is missing in a static content server.
If a requested file is not found in the backend bucket, the load balancer returns a 404 Not Found error because the content does not exist. It does not redirect, create files, or retry automatically.
You are designing a web application on GCP that serves both dynamic content from Compute Engine instances and static content like images and CSS files. Which architecture best uses backend services and backend buckets?
Think about which backend type is optimized for dynamic vs static content.
Backend services are designed to manage dynamic content from Compute Engine instances or other backends, while backend buckets are optimized for serving static content from Cloud Storage. Combining both behind one HTTP(S) load balancer is best practice.
You want to restrict access to a backend bucket so only requests coming through your load balancer are allowed. Which method achieves this?
Think about how Cloud Storage controls access to objects.
Signed URLs or signed cookies allow controlled access to backend buckets through the load balancer. Public buckets allow open access, and firewall rules do not apply to Cloud Storage buckets.
You have a backend service with multiple Compute Engine instances. You want to ensure traffic is only sent to healthy instances. Which configuration is required?
Think about how load balancers detect unhealthy instances.
Health checks allow the backend service to monitor instance health and route traffic only to healthy instances. Ignoring health or disabling checks risks sending traffic to unhealthy instances.
You want to optimize performance and reduce costs by caching static content served from a backend bucket behind a global HTTP(S) load balancer. Which approach follows best practices?
Consider how HTTP caching works with Cloud CDN and backend buckets.
Setting Cache-Control headers on objects and enabling Cloud CDN on the backend bucket allows caching at the edge, improving performance and reducing backend load. Disabling caching or bypassing CDN reduces these benefits.