Quite simply, because serving one content to all visitors is often a bad idea.
A typical example of this are ecommerce sites, where each visitor could need to see different content depending on his location. For example, consider a URL called https://example.org/some-product. Here’s what different visitors should see.
– Visitor 1, from UK: “price £120 (20% VAT included)“
– Visitor 2, from Germany: “price €119 (19% VAT included“
– Visitor 3, from the US: “price $150“
– Visitor 4, from Canada: “price CA$200“
The URL is exactly the same in call cases (there are no URL arguments), but the content is different. In short, the assumption that “one URL = one content” is incorrect, and should not be relied upon.
When a caching system is restricted to serving the same content to everybody, the only solution is to disable it on the dynamic pages, thus defeating the purpose of having one.
The solution
By allowing a dynamic cache key (which can be done with a filter), a caching system can create multiple copies of content for each URL. From the example above, instead of having one content for the four visitors, you could have:
– Visitor 1 -> Cache key = https://example.org/some-product + “UK” -> Content for UK visitors
– Visitor 2 -> Cache key = https://example.org/some-product + “DE” -> Content from German visitors
– Visitor 3 -> Cache key = https://example.org/some-product + “US” -> Content for US visitors
– Visitor 4 -> Cache key = https://example.org/some-product + “CA” -> Content for Canadian visitors
Such kind of flexibility is not just “nice to have”, but critically important for websites aimed at an international audience, where the content could vary greatly. There are caching solutions (plugins and servers) that already provide this feature, while others are being updated for that (e.g. WP Rocket, WordFence Falcon), hence my enquiry about WP Fastest Cache. ??