Skip to content

Commit c8580bd

Browse files
Upload compressed API docs index (#313)
So S3 and CloudFront would send them compressed over the wire. For Crystal 1.12.2, the index goes from 10MB down to 1.1MB over the wire. See crystal-lang/crystal#11427
1 parent 7a013f1 commit c8580bd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ publish_docs: dist-docs dist-docs_versions ## Publish API docs to S3
3434

3535
.PHONY: dist-docs
3636
dist-docs: $(OUTPUT_DIR)/api-$(CRYSTAL_VERSION) ## Sync API docs to `s3://$(AWS_BUCKET)/api/$(CRYSTAL_VERSION)`
37+
gzip $(OUTPUT_DIR)/api-$(CRYSTAL_VERSION)/index.json
38+
mv $(OUTPUT_DIR)/api-$(CRYSTAL_VERSION)/index.json.gz $(OUTPUT_DIR)/
3739
$(AWS_CLI) s3 sync "$</" "$(S3_ENDPOINT)/$(CRYSTAL_VERSION)/"
40+
$(AWS_CLI) s3 cp --content-encoding gzip --content-type 'application/json' $(OUTPUT_DIR)/index.json.gz "$(S3_ENDPOINT)/$(CRYSTAL_VERSION)/index.json"
3841

3942
$(OUTPUT_DIR)/api-$(CRYSTAL_VERSION): $(OUTPUT_DIR)/$(OUTPUT_DOCS_BASE_NAME).tar.gz
4043
mkdir -p $@

0 commit comments

Comments
 (0)