What cache headers should you use on your PHP site with CloudFlare so that "Always Online" works and your images are cached by their CDN?
The CloudFlare documentation is terrible and their support team does not seem to know.
You definitely don't want to have cache cache and private headers if you want Always Online (and many of our caches) to work correctly.
" CDN?" ( , , Flickr Facebook).
. , ( ..). CloudFlare, ( Always Online ).
Always Online "" , () , .
- "" - . , - , , , .
, ( "" Firebug Firefox, - http://web-sniffer.net/ ) . , "Cache-Control" "Expires". , , , , Cloudflare ( ), .
, -, - Cache-Control public max-age = , , , , , ..
, , - http://web-sniffer.net/, , . , http://web-sniffer.net/?url=ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
, Always Online , .
// set the most basic caching headers in PHP (cache for 1 month) header('Cache-Control: public'); header('Expires: '.gmdate('D, d M Y H:i:s', strtotime('+1 month')).' GMT');
. http://hardanswers.net/dynamic-webpage-caching .
"public" Cache-Control , (-). CloudFlare .
Cloudflare uses Mozilla / 5.0 (compatible; CloudFlare-AlwaysOnline / 1.0; + http://www.cloudflare.com/always-online) as a user agent. You can tell CloudFlare about caching your pages using PHP or .htaccess (see Ned Martin's solution), but tell other visitors not to cache your pages.