 
  My Website Header
Subject: Content not Being Cached
After activating Cloudflare on my site, I am seeing that resources on my pages are not being cached:
curl -svo /dev/null roskolniv.us
* Rebuilt URL to: roskolniv.us/
* Trying 104.16.27.128...
* Connected to roskolniv.us (127.0.0.1) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.40.0
> Host: roskolniv.us
> Accept: */*
< HTTP/1.1 200 OK
< Date: Mon, 22 Jun 2015 03:03:59 GMT
< Content-Type: text/html; charset=utf-8
< Transfer-Encoding: chunked
< Connection: keep-alive
< Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0
< Strict-Transport-Security: max-age=10
< X-Powered-By: Express
< Server: cloudflare-nginx
< CF-RAY: 1fa4b922fef517a4-SIN
{ [3507 bytes data]
* Connection #0 to host roskolniv.us left intact
Why is Cloudflare’s caching not working on my site?
ANSWER:
Hi My name is Ricardo Vicente and I am the Support Professional assigned to work with you on this support case.
The issue you're seeing with Cloudflare not caching your resources likely stems from the Cache-Control headers being sent by your origin server. Let's break down what's happening and how to fix it.
Your origin server is sending the following header:
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0, max-age=0
This header explicitly tells Cloudflare not to cache the content. Cloudflare respects origin headers unless you override them with a Page Rule or Cache Rule.
*How to fix it
You have a few options depending on your needs:
1.
Modify your origin server headersUpdate your server configuration to send more cache-friendly headers. For example:
Plain Texthttp isn’t fully supported. Syntax highlighting is based on Plain Text.Cache-Control: public, max-age=86400
This tells Cloudflare (and browsers) to cache the content for 1 day.
2.
Use Cloudflare Cache Rules or Page RulesIf you can't change your origin headers, you can override them in Cloudflare:
Go to Cloudflare Dashboard > Rules > Cache Rules
Create a rule for your domain or specific paths
Set "Edge Cache TTL" to a desired value (e.g., 1 day)
Optionally, enable "Cache Everything" if you're caching HTML too
3.
Check for dynamic content
If your site is built with Express (as the header suggests), it may be serving dynamic content. Cloudflare by default doesn’t cache HTML unless you use “Cache Everything” in a rule.
Test after changes
After applying changes, test again with:
Look for headers like:
*cf-cache-status: HIT (means Cloudflare cached it)
*Cache-Control: public, max-age=...