
Optimizing Large Document Rendering in ASP.NET Core
Speed is a Feature
When a user clicks "View Document", they expect it to load instantly. Whether it's a 3-page memo or a 5,000-page legal brief, waiting is not an option. Doconut renders documents on your server, while application and infrastructure design determine performance at enterprise scale.
1. Smart Caching Strategies
Repeatedly rendering the same page is a waste of CPU cycles. Doconut's built-in caching interface allows you to store rendered page images efficiently.
- Disk Caching: Great for single-server setups with fast NVMe storage. Rendered pages are saved to
App_Dataand served statically on subsequent requests. - Distributed Deployments: Doconut supports web farms; use the documented shared widget store and coordinate application-level caching across nodes.
2. Lazy Loading & Virtualization
Never send the whole document at once. Doconut uses a virtualized scrolling approach.
- Only the visible pages (plus a small buffer) are requested from the server.
- As the user scrolls, new pages are fetched on-demand. This limits the amount of rendered content requested during the initial view.
3. Concurrency & Threading
In ASP.NET Core, resource management is crucial.
- Parallel Processing: Doconut can utilize multi-core CPUs to pre-render adjacent pages while the user is reading the current one.
- Token Management: Close document handles (
objDoc.Close()) immediately when they are no longer needed (or useusingblocks) to keep memory footprint low.
4. Format-Specific Optimizations
- PDFs: Ensure "Fast Web View" (Linearization) isn't strictly necessary for Doconut (since we render on server), but optimized internal structures help.
- Images: For huge TIFFs/JPEGs, enabling Doconut's tiled rendering can prevent OutOfMemory exceptions by processing the image in chunks.
Scaling Up
For scaled deployments, Doconut supports web farms and distributed operation. Doconut.Clouds can read documents from providers such as Amazon S3 and Azure, while capacity planning and traffic handling remain responsibilities of your application infrastructure.
Deliver lightning-fast document viewing with a tuned Doconut implementation.