A PDF file is a collection of numbered objects — pages, fonts, images, annotations — plus a cross-reference table that records the byte position of every object so readers can jump straight to what they need. Older PDF generators write each object and its bookkeeping uncompressed, which wastes space; files edited repeatedly accumulate further structural slack. LuraPDF's optimizer loads the document with pdf-lib and writes a brand-new file using object streams, a PDF 1.5 feature that groups non-stream objects together and compresses them as a unit. The content of every object — the actual text, image data, and vector drawing commands — is carried over unchanged.
If you enable metadata stripping, the optimizer also clears the document information dictionary: title, author, subject, keywords, creator, producer, and the creation and modification dates. This both saves a little space and removes provenance details you may not want to share. Everything runs in client-side JavaScript inside your browser tab — no upload, no server, no queue. Because nothing is rasterized, optimization is fast and memory-light even on mobile devices, and the result is a conformant PDF that behaves identically to the original in every reader.