# mpa-archive - 웹사이트를 zip 으로 만들고, zip파일에서 바로 서빙하는 도구

> Clean Markdown view of GeekNews topic #15308. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=15308](https://news.hada.io/topic?id=15308)
- GeekNews Markdown: [https://news.hada.io/topic/15308.md](https://news.hada.io/topic/15308.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2024-06-13T09:26:01+09:00
- Updated: 2024-06-13T09:26:01+09:00
- Original source: [github.com/potahtml](https://github.com/potahtml/mpa-archive)
- Points: 17
- Comments: 0

## Topic Body

- 다중 페이지 웹앱을 Zip 파일에 크롤링하고 바로 서빙 가능한 Multi-Page Application(MPA) Archiver   
- `mpa http://example.net` 하면 헤드리스 Puppeteer를 이용하여 재귀적으로 크롤링 ( CPU 수 / 2 개의 쓰레드 사용 )  
- Sitemap을 가져와서 시드포인트로 사용   
- 사이트 URL만 크롤링 하지만, 외부 리소스도 `fetch`함   
- 사이트의 리소스들을 두 저장   
- `mpa/sitemap.txt` 와 `mpa/sitemap.xml` 을 생성함   
- 중단 되면 재시작 가능. URL 250개마다 체크포인트를 저장함   
- SPA의 경우 --spa 옵션으로 원본 HTML을 저장 가능

## Comments



_No public comments on this page._
