How to Fix Office Online Viewer Cannot Open Public Documents from Subdomains
Question details
The user is unable to open publicly hosted documents from a specific subdomain using the Office Online Viewer and is experiencing caching issues with expired one-time server links.
- Product
- Office Online Viewer
- Device & OS
- not provided
- Scenario
- Attempting to view a publicly hosted document on a subdomain using the Office Online Viewer, particularly with documents that use one-time expiring access links.
- Observed behavior
- The document initially fails to load due to Web Application Firewall (WAF) blocks. Once resolved, the viewer incorrectly displays cached copies of the document even after the original one-time server link has expired.
Verify that your document URL is publicly accessible without requiring authentication, and ensure you have administrative access to your server's caching and firewall rules.
Configure Cache-Control Headers for One-Time Links
Applying strict cache-control headers on your origin server prevents the Office Online Viewer from storing and displaying expired copies of one-time access documents.
Office Online Viewer leverages aggressive caching to improve performance. When using one-time expiring links, this caching mechanism can inadvertently keep a document accessible after the link expires. Forcing strict no-cache headers resolves this.
Log in to your document's origin server or hosting control panel.
Configure the HTTP response headers for your document URLs to explicitly include 'Cache-Control: no-store, no-cache, must-revalidate'.
Check your Content Delivery Network (CDN) or proxy layer settings to ensure they are configured to bypass caching for these specific document URLs.
Implement short-lived signed URLs on your storage bucket or server to enforce strict expiration times at the server level.

Resolve Web Application Firewall (WAF) Geolocation Blocks
Adjust your Web Application Firewall settings to allow requests from the geographic locations of the Office Online Viewer servers.
Use WPS Office for Reliable Document Viewing and Editing
If you are experiencing caching limitations or access errors with Office Online Viewer, consider switching to WPS Office. It provides a lightweight, highly compatible, and completely free alternative for viewing, editing, and managing your Office documents across all platforms.
- 1. Download WPS Office: Visit the official WPS website and download the free desktop or mobile application.
- 2. Open Your Document: Launch WPS Office and open your hosted documents directly without relying on third-party online viewer caching layers.
- 3. Manage Access Securely: Use WPS Cloud features to share links with custom expiration dates and secure password protection.

Frequently Asked Questions
Why does Office Online Viewer show an old version of my document?
Office Online Viewer relies heavily on server caching to improve loading speeds. If your origin server does not have strict 'no-cache' and 'no-store' headers configured, the viewer may display a previously saved version instead of fetching the latest update.
Can I use Office Online Viewer for one-time expiring links?
It is highly discouraged. The viewer's architecture uses intermediate proxy layers that cache document contents, meaning the document might remain visible in the viewer's cache even after your original server link has explicitly expired.
How do I fix URL encoding errors in my public document links?
Ensure that all spaces and special characters in your document URL are properly URL-encoded (for example, replacing spaces with '%20'). Unencoded characters can break the URL structure, causing the viewer to fail to locate the file on your subdomain.
Why does the document open directly in a browser but not in the viewer?
Browsers fetch the file directly from your local network or IP, whereas the Office Online Viewer fetches the file using Microsoft's external servers. If your server's firewall blocks external IP ranges or specific countries, the viewer will be denied access.




