What’s new
Resource failures now answer by their cause, so a client can tell a request it must change from one it can retry.
Retry a temporary storage failure
When gPdf cannot read a font that a strict style names, or an image asset,
because its storage did not answer, the request returns API-504 with HTTP
500 and a message such as
Font temporarily unavailable: <face> (storage or network failure; retry the request)
or Image temporarily unavailable: <key> (...). Retry the unchanged request
with backoff. Before, the font case returned the strict coverage error
API-002 with HTTP 400, and the image case returned API-506 “Image not
found”.
A font in prefer or auto mode still falls back through the bundled families
when it cannot be loaded, and returns API-504 only when nothing covers the
text.
Image assets follow the per-image byte limit
An image asset has the same per-image byte limit as an inline image: 32 KiB
for raster images and 256 KiB for SVG. When every stored file of an asset
key exceeds it, the request returns API-007 with HTTP 400, after gPdf tries
the key’s other candidates. Before, it returned API-506 with HTTP 500, and
the key stayed “not found” for 10 minutes even after a smaller file was
stored.
Unchanged
A font that a strict style names and that is not stored still returns
API-002. An image asset that is not stored still returns API-506, and gPdf
remembers that for up to 10 minutes per runtime instance.
Image asset keys and formats
An asset key without an extension is looked up as the bare key and with each
supported extension, the format’s first. When a stored variant’s storage does
not answer, the request answers API-504 instead of serving a lower-priority
variant. gPdf now caches the result by key and format, so two
requests that name the same key with different formats each get the stored
image their format finds first.
Compatibility
Requests that load their fonts and images successfully render as before.
Clients can retry an API-504 whose message says temporarily unavailable;
an API-504 for exhausted font fallback, an API-002 and an API-007 need a
changed request, so downscale an oversized asset instead of retrying it. See the
error codes and the
API reference changelog.