Closed lukaslentner closed 3 years ago
When building, put everything in a subfolder that is called "version-". Only the index.html stays in the root folder and is manipulated:
In the code every file reference must be prefixed with "~~~version-folder/../". Then while building, This prefix is replaced by "version-/".
The whole thing is uploaded to S3 and offered via Cloudfront which has a 360-day cache for all version-* folders configured.
Thus, you always have the newest index.html, but everything else is cached hardly...
When building, put everything in a subfolder that is called "version-". Only the index.html stays in the root folder and is manipulated:
In the code every file reference must be prefixed with "~~~version-folder/../". Then while building, This prefix is replaced by "version-/".
The whole thing is uploaded to S3 and offered via Cloudfront which has a 360-day cache for all version-* folders configured.
Thus, you always have the newest index.html, but everything else is cached hardly...