BFCache in WordPress: Instant Navigation and the No-cache BFCache Plugin - Affinite.io

What is BFCache and How It Works

Back/Forward Cache (bfcache) is an advanced feature of modern web browsers that dramatically speeds up navigation between pages. Unlike traditional HTTP cache, which only stores responses to previous requests, bfcache retains a complete snapshot of the entire page in memory.

How It Works

When a user leaves a page, the browser doesn’t release its resources but instead:

When navigating back/forward, the browser simply restores the saved snapshot—no network requests, no reloading, no script re-execution.

User Experience

BFCache significantly improves user experience:

Speed: Navigation is virtually instant—comparable to switching browser tabs.

State Preservation: All forms, scroll positions, and JavaScript states remain intact. The user returns exactly where they left off.

Data Savings: Eliminates unnecessary network requests, which is especially important on mobile devices with limited data plans.

According to Chrome statistics, back/forward navigations account for up to 10% of all desktop navigations and 20% on mobile. With active bfcache, billions of unnecessary requests could be eliminated daily.

Browser Support

Current Support

BFCache is supported in all major modern browsers:

Unlike newer technologies such as the Speculation Rules API (supported only in Chromium), bfcache enjoys broad support across all browsers.

What Happens Without Support

If a browser doesn’t support bfcache (very rare in modern browsers), back/forward navigation behaves the traditional way:

WordPress and the no-store Problem

Default WordPress Behavior

By default, WordPress blocks bfcache for logged-in users by sending the HTTP header:

Cache-Control: no-cache, no-store, must-revalidate, private

The no-store directive explicitly forbids storing the page in any cache, including bfcache.

Reasons for the Security Measure

This restriction was introduced to protect privacy in the following scenario:

Performance Impact

This security measure has a significant negative performance impact:

No-cache BFCache Plugin: The Solution

How the Plugin Works

The No-cache BFCache plugin elegantly resolves the conflict between security and performance through several mechanisms:

1. Conditional Removal of no-store

The plugin removes the no-store directive from HTTP headers, but only under these conditions:

2. Session Token System

On login:

On each authenticated page:

3. Automatic Invalidation

When returning to a cached page:

Why Use the Plugin

Dramatic navigation speed-up:

Better User Experience:

Technical Advantages:

Security Aspects

Remaining Risks

Despite the plugin’s advanced protections, theoretical risks remain:

Vulnerability Window:

JavaScript Dependency:

Plugin Safeguards

Multiple Layers of Protection:

User Choice:

Plugin Benefits

Performance Gains

Measurable Improvement:

Wider Impact:

Practical Advantages

For Administrators:

For End Users:

Compatibility

The plugin is designed with future WordPress core integration in mind and is compatible with:

Conclusion

The No-cache BFCache plugin represents a major step forward in WordPress performance optimization. It elegantly resolves the long-standing conflict between security and speed, giving users the choice between maximum protection and optimal performance

Vulnerabiltiy in  AI Engine for WordPress plugin
Vulnerabiltiy in AI Engine for WordPress plugin
30 Jul, 2025

Looking for something?