I need to serve static HTML Pages w/ multiple assets (html, css, js & other asset files) but with different conditions:
- Serverless (must be on S3)
- Can handle multiple static Pages w/ multiple pages and other static assets like css, js, image or font files. (see example below)
- Has an expiration - The goal is the user cannot share the limited-time URL of the static HTML page
Below are all my ideas (correct me if I'm wrong):
- Render directly on Web level - Web support rendering of a specific asset but cannot create a new page for loading all assets
- Serve on S3 level - The question is how can you authorize users w/ limited-time access to multiple files?
- Presigned URL? - A pre-signed URL is valid for only one object.
- Store on S3 bucket and Serve on CloudFront - Same question on S3 level. How can you authorize users w/ limited-time access to multiple files?
- Serve on S3 level publicly - Every time user requests access, copy all files to a new public folder w/ expiration, serve publicly and give the new URL to the user.
- maybe slow? maybe costly?
#example file structure
.
+-- index.html
+-- media
| +-- banner.jpg
| +-- video.mp4
+-- styles
| +-- main.css
+-- js
| +-- main.js
+-- about.html
+-- contact.html
Any advice and suggestions will be greatly appreciated.