Click or drag to resize
Pdf Library for .NET

HttpCacheMode Enumeration

Selects what the Chromium engine's HTTP cache keeps from one conversion for the next.

Namespace: SelectPdf.Universal
Assembly: SelectPdf.Universal (in SelectPdf.Universal.dll) Version: 26.4
Syntax
public enum HttpCacheMode
Members
Member nameValueDescription
Clear0 Nothing is kept: every conversion starts with an empty HTTP cache, so no conversion can see a response another conversion fetched.
ThirdParty1 Resources from other sites (fonts, style sheets and scripts served from content delivery networks, for example) are kept for the next conversion; the converted page's own site - the page, its base URL, a login page and any page it redirects to - is never read from or written to the cache.
All2 Everything is kept for the next conversion. This is the fastest mode for pages converted repeatedly, but a response fetched by one conversion can be served to the next one: do not use it when conversions run on behalf of different users whose responses must stay separate, or when a page's content changes while its URL stays the same.
Remarks
The setting applies when the engine runs inside the application (InProcess). A conversion that runs in its own engine process always starts with an empty cache, whatever this setting says.

Cookies and site storage (localStorage, sessionStorage, IndexedDB) are cleared after every conversion in every mode. Requests that carry the conversion's own credentials, cookies or custom HTTP headers never read from or write to the cache.

Example
HtmlToPdf converter = new HtmlToPdf();
converter.Options.HttpCache = HttpCacheMode.ThirdParty;
See Also