Open arkylin opened 1 year ago
哦了?yarn start 要等二十多分钟才能启动起来。是因为这个吧?有无更换的步骤介绍下。后端初涉前端开发。
不清楚,我是在访问页面-打开PDF文件的时候发现打开很慢,然后一查发现是cloudflare的cdn加载的文件速度很慢
For users in mainland, you can easily change this setting without self-build the frontend:
./cloudreve -eject
to extract the built-in static resources into statics
directory;./statics/static/js/pdf.________.chunk.js
, replace i.pdfjs.GlobalWorkerOptions.workerSrc="//cdnjs.cloudflare.com/ajax/libs/pdf.js/".concat(i.pdfjs.version,"/pdf.worker.js");
to i.pdfjs.GlobalWorkerOptions.workerSrc="//lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/pdf.js/".concat(i.pdfjs.version,"/pdf.worker.js");
;Hint: Here use the pdf.worker.js
provided by ByteDance Public CDN, from cdn.bytedance.com
, use other source is also okay.
使用Cloudflare CDN加载pdf.worker.js速度很慢,导致加载pdf很慢,建议更换其他在国内外加载速度都很快的CDN或者文件本地化
pdfjs.GlobalWorkerOptions.workerSrc =
//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjs.version}/pdf.worker.js
;