We currently dynamically import('pdfjs-dist') when displaying the first PDF file. This is good for initial bundle size, but I conjecture that it taxes the server a fair amount (just later instead of earlier). We can fix this like we do with Cocreate, by using a CDN. For example, https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174 is 320 kB, so we'd be offloading roughly that much server work for each user.
We currently dynamically
import('pdfjs-dist')
when displaying the first PDF file. This is good for initial bundle size, but I conjecture that it taxes the server a fair amount (just later instead of earlier). We can fix this like we do with Cocreate, by using a CDN. For example, https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174 is 320 kB, so we'd be offloading roughly that much server work for each user.Similarly, https://cdn.jsdelivr.net/npm/chart.js@2.9.4 is 173kB (but only used in Stats view, so less common)