How to cache thumbnails with CloudFlare?

­

This article assumes you already use CloudFlare, but it's not caching your thumbnails. If you don't have CloudFlare yet, follow their guides. Activating CloudFlare on your site in itself doesn't have anything to do with JIG and it's a major site-level change. It's worth it though.

  1. Log in to your CloudFlare
  2. Select your site
  3. Go to Page Rules
  4. Click Create Page Rule
  5. Add this to the If the URL matchesWhere you replace justifiedgrid.com with your own domain of course.
  6. Click Add a Setting
  7. Choose Cache Level and set it to Cache Everything
  8. Hit Save and Deploy
To verify it works
  1. Open a page on your site that has JIG, in a browser like Chrome
  2. Right click and Inspect
  3. Choose the Network tab
  4. Refresh the page
  5. Find a link that begins with timthumb and click it
  6. On the right, find Response Headers > cf-cache-status:HIT

If cf-cache-status is not there, it is not working. If it's there but says MISS, it just means it's CloudFlare's first time encountering that image for your region and with subsequent page loads it'll turn to HIT (for you and anybody else in your region).

 

This FAQ entry was posted in Behavior on November 1, 2017