Detect server response before caching page

I’ve created a page rule to cache a static page:

domain.com/
Cache Level: cache everything
Edge Cache TTL: 2 hours

There’s generally no problem, but several times the server has returned an error, or there’s been a connection timeout, and Cloudflare has cached this result. How can I test for a 200 before caching the response?

This doc tells you how long certain http status pages are cached for:

  • We will default to the following TTL depending on the return code:
200 301    120m;
302 303    20m;
403        5m;
404        5m;
any        0s;

I believe timeouts are in the 5xx range. They should not be cached.