Skip to content

Instantly share code, notes, and snippets.

@pwenzel
Created December 17, 2012 21:21
Show Gist options
  • Save pwenzel/4322385 to your computer and use it in GitHub Desktop.
Save pwenzel/4322385 to your computer and use it in GitHub Desktop.
Make Cloudflare cache Wordpress pages for 5 minutes
<?php
if(!is_404()) {
// Set caching headers (cache for 5 minutes)
header('Cache-Control: max-age=300, must-revalidate');
header('Expires: '.gmdate('D, d M Y H:i:s', strtotime('+5 minutes')).' GMT');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment