Citoid service performance assessment for PDF parsing feature
WMDE’s Technical Wishes is currently working on a new feature for the Citoid service. Users should be enabled to add URLs linking to PDF documents to create more meaningful citations. For some more background see the Epic T424982: Investigate feasibility of Citoid supporting PDF sources.
We currently already developed a first MVP version that we would like to deploy to iterate on further. See T427604 and the MVP patch 1301347. Before proceeding, we'd like to get feedback on the approach mainly regarding these topics:
The dependency we’re adding
- Do you have any concerns about adding the pdf-parse package as additional dependency? We’re using this to extract the metadata from the PDF file. In a 2nd step we might also use it to extract content.
The operational impact
- We need to load the PDFs into memory to extract its metadata, but want to keep the memory footprint low. So for the start we’ll cap PDF files at 10MB. Do you have any other concerns about the potential increase in server load from downloading and parsing PDFs in memory?
Precautions we’re already implementing
- For now we’re only reading the property metadata of the PDFs. A second iteration might be to extract content from the first page to increase chances of creating a meaningful citation
- The MVP currently does stop loading PDFs that are larger than 10MB.
- The feature is hidden behind a feature flag the API does only allow PDFs when a certain get parameter is used
Conditional deployment plan
- First deployment to test.wikipedia.org, we'll ask volunteers to test it out. Very low traffic expected. Timeline: October-November 2026
- Second deployment to 1-2 pilot wikis. We will select 1 mid-sized and 1 large wikis (dewiki) to generate enough data to validate the benefit of the feature. Note that having a PDF handy is contextual and depends on the source being added as a reference, we expect ~ 200 average PDFs per day. Timeline: November-December 2026 (depending on outcome of first step)
- Third global rollout. Timeline December 2026 - January 2027 (again depending on outcome of previous step)
Please let us know if you need anything else to help with this assessment or if you see any other things we should take into account for the MVP.
Thanks 🙏.