First we might want to consider a new endpoint for getting content that would potentially bypass OpenOverlay entirely.
This is a performance issue, since clients that have 100+ page PDFs that do not have any overlays configured OR view a document that doesn't fit any restrictions have to wait for OpenOverlay/iText to loop through every page of the PDF. OpenOverlay should be smart to realize that the document doesn't need any overlays and just stream the PDF back as is before letting iText muddle through the entire PDF.
I realize why it was done this way since there can be some overlays that only apply to some pages of the document, so we need to loop through every page to see if this overlay applies. We might be able to be smart in OpenOverlay and say if they didn't use any page.size restrictions or page.orientation restrictions to not loop through every page.
First we might want to consider a new endpoint for getting content that would potentially bypass OpenOverlay entirely.
This is a performance issue, since clients that have 100+ page PDFs that do not have any overlays configured OR view a document that doesn't fit any restrictions have to wait for OpenOverlay/iText to loop through every page of the PDF. OpenOverlay should be smart to realize that the document doesn't need any overlays and just stream the PDF back as is before letting iText muddle through the entire PDF.
I realize why it was done this way since there can be some overlays that only apply to some pages of the document, so we need to loop through every page to see if this overlay applies. We might be able to be smart in OpenOverlay and say if they didn't use any page.size restrictions or page.orientation restrictions to not loop through every page.