Skip to main content

filter · Cache control

Extend cache for PDFs (extend_cache_pdfs)

Category:
Caching
CoreFilters:
No
OptimizeForBandwidth:
No
Risk:
Generally safe

Applies the same content-hash-based cache extension to PDF file links. Enable this filter if your site serves PDFs that change infrequently.

When to use it

  • Not in CoreFilters: it runs only when you enable it by name.
  • Risk rating on these docs: Generally safe.

Risks

The Cache control page lists no specific risks for this filter. If a page misbehaves with it, DisableFilters extend_cache_pdfs turns it off for the scope you set it in.

Configuration

Enable it in the module configuration, at server, virtual-host or location scope:

Apache

ModPagespeedEnableFilters extend_cache_pdfs

nginx

pagespeed EnableFilters extend_cache_pdfs;

IIS (pagespeed.config)

pagespeed EnableFilters extend_cache_pdfs

On the worker

The worker runs its own pipeline, configured by flags. Its equivalent of this filter is the cache extension transform. Always-on under pagespeed on;.

Scoping, ForbidFilters and the thresholds filters read: Choosing filters .

Live example

Applies cache extension to linked PDF files.

This filter changes how the page is structured or delivered, not its size, so the example shows a source diff rather than a byte or request reduction.

See the before and after, with the source diff →

Frequently asked questions

What does the extend_cache_pdfs filter do?
Applies the same content-hash-based cache extension to PDF file links. Enable this filter if your site serves PDFs that change infrequently.
Is extend_cache_pdfs enabled by default?
No. extend_cache_pdfs is not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name with EnableFilters.
How do I enable extend_cache_pdfs on Apache and nginx?
Add ModPagespeedEnableFilters extend_cache_pdfs on Apache or pagespeed EnableFilters extend_cache_pdfs; on nginx. On IIS, add pagespeed EnableFilters extend_cache_pdfs to pagespeed.config.

This page is drawn from the extend_cache_pdfs entry on Cache control. Every filter in one table: PageSpeed filters.

Search