Quick CloudFlare 'new user' question for you:
QUESTION: Given that CloudFlare does not cache HTML by default, how shall I construct my Page Rules so that a single cached copy of https://www.example.com/private/my-investments?[anyValue] is returned to all users? Here's what I've tried:
"CACHE EVERYTHING:" Using the 'Cache Everything' directive causes my HTML to be cached (good) but it uses the entire query string as part of the cache key (bad). So if a user hits the following URL...
...and then ten seconds later hits the same URL with a different query string, like:
...CloudFlare treats that latter request as a cache MISS (cf-cache-status:MISS) and hits my origin server again. This in spite of the fact that the HTML returned from the origin is identical for both URLs.
"IGNORE QUERY STRING CACHING:" I thought for sure I'd fix this problem by selecting the "IGNORE QUERY STRING CACHING" option. But when using this option in a Page Rule, no HTML is cached at all; Only .js, .css, and .png files are cached. And once again my origin gets hit for every single call for HTML data. :(
I feel like I must be missing something obvious. Any thoughts?
UPDATE: Had an idea I want to run by you. Could I solve this problem by changing my internal URL scheme to use '#' instead of '?' So instead of a URL like...
..I'd use something like:
This would prevent the query string parameters from being transmitted to CloudFlare at all... What do you think?