chrisvfritz / prerender-spa-plugin

Prerenders static HTML in a single-page application.
MIT License
7.32k stars 634 forks source link

puppetter not caching assets from cdn when prerendering #398

Open duanyukai opened 4 years ago

duanyukai commented 4 years ago

I have set publicPath in webpack for using cdn to host my js assets. So I setup a two step building procedure, first build and upload assets to cdn server, then rebuild and use prerender plugin to render html files. But I found each prerendering pages not using cache, so render 100 pages may cost my 100x5=500MB bandwidth. (quite expensive) I'm wondering if puppetter could setup use of cache for bandwith saving.

When using laptop with bad network, prerender could even fail due to slow loading of assets from cdn server.

JoshTheDerf commented 4 years ago

I'm not sure if there's a reasonable way to handle this on the puppeteer end, but I'll look into it if I get a chance.