mdn / stumptown-deployer

🚢 those static Stumptown sites
Mozilla Public License 2.0
3 stars 6 forks source link

Support redirect files #11

Closed peterbe closed 4 years ago

peterbe commented 4 years ago

One thing I noticed when working in Project Milton is that Kuma contains a LOT of redirects. About 70,000 in fact. That's so many that it would suck to put them all in one massive file and try to upload that to a Lambda@Edge function.

peterbe commented 4 years ago

In Project Milton, the cli in stumptown-renderer produces a index.redirect for every directory that needs a redirect. For example a file like stumptown-renderer/client/build/en-US/docs/XUL:Attribute:enableColumnDrag/index.redirect that simply contains this: /docs/en/XUL/Attribute/enableColumnDrag

So the stumptown-deployer just needs to loop over the .redirect files too and create an empty S3 key with redirect metadata.

peterbe commented 4 years ago

Any objections @escattone ? Or perhaps the question is premature without bigger context?

peterbe commented 4 years ago

I fumbled on the PR description and forgot to mention this issue. But https://github.com/mdn/stumptown-deployer/pull/13 resolves this issue.

peterbe commented 4 years ago

The way it works is that stumptown-deployer upload ... can recognize index.redirect files and it opens its content and creates a index.html in S3 with the appropriate redirect meta tag.