Skip to content

Post Processor Cache

Weston Ruter edited this page Mar 16, 2020 · 5 revisions

This is obsolete as of AMP v1.5 since the Post-Processor Cache has been removed due to not being effective.


To speed up responses, the AMP plugin leverages WordPress' object cache to more quickly serve the AMP response for a WordPress URL that was previously transcoded and validated by the sanitizers in the post-processor phase of the plugin. Each time the content on a page changes or a new URL is processed, the post-processing of the output buffer of the rendered template is cached for later retrieval. We call this post-processor caching.

Note that this post-processor cache is different from the full-page caching commonly used in plugins (e.g. Batcache) and reverse proxies (e.g. Varnish). These full-page caches short-circuit WordPress from rendering a template at all. The post-processor cache, however, only short-circuits the logic from running after the template renders during AMP post-processing.

Automatically Disabling of the Post-Processor Cache

Certain themes and plugins have randomly generated content. The content can be created by a widget, shortcode, template, or Gutenberg block. For example, the Twenty Seventeen theme uses a random generator for setting unique HTML ID attributes.

What happens when the content changes? It will not be found in the response cache. The plugin must reprocess the content and store it into the cache.

In essence, the cache can fill up with old content.

The plugin monitors for this condition. When it detects it, the response cache is automatically turned off.