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_pdfsnginx
pagespeed EnableFilters extend_cache_pdfs;IIS (pagespeed.config)
pagespeed EnableFilters extend_cache_pdfsOn 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.
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_pdfsis not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name withEnableFilters. - How do I enable extend_cache_pdfs on Apache and nginx?
- Add
ModPagespeedEnableFilters extend_cache_pdfson Apache orpagespeed EnableFilters extend_cache_pdfs;on nginx. On IIS, addpagespeed EnableFilters extend_cache_pdfsto pagespeed.config.
Related filters
- local_storage_cache — Local storage cache
- rewrite_domains — Rewrite domains
- extend_cache — Extend cache
This page is drawn from the extend_cache_pdfs entry on Cache control. Every filter in one table: PageSpeed filters.