Creating CDN for both client side and server-side application when they are deployed

·

1 min read

I am creating a web application using vue.js for the front-end and rails for the server. I would like to deploy the front-end on S3 and Rails on ECS. Both Client side vue.js and Server side rails use CDN. I noticed CDN has multiple origins. In this situation, creating two CDN for each client side and server side is normal? This is the question I had, so I researched the common practice and why.

In this situation, it is more common to create two separate CDNs – one for your client-side Vue.js application and another for your server-side Rails application. This approach provides several benefits:

  1. Separation of concerns: By using separate CDNs, you can independently manage and configure the caching, invalidation, and other settings for both the client-side and server-side applications. This makes it easier to maintain and troubleshoot issues related to caching and content delivery.

  2. Different cache settings: Client-side and server-side applications usually have different caching requirements. For example, static assets like JavaScript, CSS, and images from your Vue.js application might have longer cache durations, while API responses from your Rails application might require shorter cache durations or even be dynamic and not cached at all. Using separate CDNs allows you to configure these settings independently for each application.