Skip to content

PdfCacheRequest

PdfCacheRequest is the request contract for reading a cached PDF by its source id. It is a contract only — PdfAPI.Core performs no cache I/O; consumers honour CacheType and Id against their own cache store.

Purpose

  • Carries the source id, PDF/A flag, and target CacheType needed to look up a cached PDF.
  • Exposes a computed validity flag (IsValid) that gates whether a lookup should proceed. (BR-43)

Context

  • Namespace: PdfAPI.Core.Cache
  • Assembly/package: PdfAPI.Core

Public members

Member Signature Purpose
RequestId Guid RequestId { get; } A new Guid generated per request instance, identifying this specific lookup.
PdfCacheRequest(long, bool, CacheType) PdfCacheRequest(long id, bool pdfa = false, CacheType cacheType = Image) Constructs a cache request for the given source id, PDF/A flag, and cache type.
CacheType CacheType CacheType { get; set; } The cache store to query.
Id long Id { get; set; } The source id of the PDF to look up.
Pdfa bool Pdfa { get; set; } Whether the cached PDF should be the PDF/A variant.
IsValid bool IsValid => Id > 0 true only when Id is a positive value. (BR-43)

Behavioral notes

  • IsValid treats any non-positive Id (zero or negative) as an invalid request, with no other field contributing to validity. (BR-43)

Constraints and usage notes

  • Check IsValid before issuing a cache lookup with a caller-supplied Id.

Sources

  • PdfAPI.Core\Cache\PdfCacheRequest.cs