Skip to content

Add PDF streaming viewer and token caching#174

Open
akashroy8210 wants to merge 1 commit into
devfrom
feature/pdf-viewer-streaming
Open

Add PDF streaming viewer and token caching#174
akashroy8210 wants to merge 1 commit into
devfrom
feature/pdf-viewer-streaming

Conversation

@akashroy8210

Copy link
Copy Markdown

Changes

  • Added backend PDF viewing endpoint.
  • Streams PDFs from Microsoft Graph instead of redirecting users to the OneDrive preview page.
  • Eliminates repeated OneDrive authentication prompts.
  • Added access token caching to reduce request latency.
  • Opens PDFs in a new browser tab using the browser's native PDF viewer.

Performance

Observed timings after caching:

  • MongoDB lookup: ~5–15ms
  • Access token retrieval: ~0–5ms (cached)
  • Microsoft Graph fetch: ~700–800ms
  • End-to-end PDF open time: typically under 1 second

User Impact

Users can now open PDFs directly in a new browser tab without being redirected to OneDrive or repeatedly authenticating.

@akashroy8210 akashroy8210 requested a review from DreamBot706 June 19, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants