Interview Prep/CI/CD/Builds, Artifacts, Nexus, SonarQube and Testing

A frontend build must publish static assets to S3 and invalidate CloudFront safely.

IntermediateScenarioBuilds, Artifacts, Nexus, SonarQube and Testing
Answer

Situation read → Static deploy with cache control.

What I'd do →

  1. Build with hashed filenames; upload assets with long cache headers: aws s3 sync dist/ s3://bucket --cache-control "public,max-age=31536000,immutable" --exclude index.html.
  2. Upload index.html last with no-cache.
  3. Invalidate only /index.html or the changed paths: aws cloudfront create-invalidation --distribution-id $ID --paths /index.html.

Why → Hashed assets never need invalidation, which is faster and cheaper.

Interview tip → Upload order prevents broken pages mid-deploy.

All CI/CD questions Roadmap: CI/CD fundamentals

More on Builds, Artifacts, Nexus, SonarQube and Testing