Cache Rules: What happens if Edge TTL is set less than minimum for my plan?

What is the name of the domain?

tracmapdev.com

What is the issue you’re encountering

In our Cache Rules setting we set the Edge TTL time to 1 second but the minimum for our plan is two hours. What should we expect to happen?

What steps have you taken to resolve the issue?

I have a question about the behaviour of the Edge TTL setting in Cache Rules when the value is set less than allowed by our plan. Will responses be potentially cached for the minimum of two hours (free plan)? Or are they never cached?

To give a specific example: one of our Cache Rules had the Edge TTL set to 1 second which is less than our free plan minimum of two hours. In our testing we are always seeing Cf-Cache-Status: EXPIRED in responses to the browser suggesting the 1 second Edge TTL is being applied. But other sites in a different geographical location have reported getting stale content which I’ve not been able to reproduce so far.

What are the steps to reproduce the issue?

  1. Create a Cache Rule.
  2. Set Edge TTL to “Ignore cache-control header and use this TTL”.
  3. Type “1 second” in the drop down.
  4. Set Browser TTL also to Override.
  5. Type “1 second” in the drop down.

See attached screenshot.

The account audit log should show the following settings were applied.

        {
            "id": "-",
            "ref": "-",
            "action": "set_cache_settings",
            "enabled": true,
            "version": "4",
            "expression": "true",
            "description": "Set Browser/Edge Cache Timeout",
            "last_updated": "-",
            "action_parameters": {
                "cache": true,
                "edge_ttl": {
                    "mode": "override_origin",
                    "default": 1
                },
                "browser_ttl": {
                    "mode": "override_origin",
                    "default": 1
                }
            }
        }

Sorry screenshot got lost from my original post.

Example browser headers as seen in Chrome (sorry I don’t seem to be able to edit my original post)

Huh…I thought those limits got lifted a while ago.

What will happen? Your cache will expire at whatever TTL you set it to. Even if it’s just 1 second.

Is it not doing that?

Thanks for your reply. I’m taking the two hour minimum TTL from the docs: Edge and Browser Cache TTL · Cloudflare Cache (CDN) docs

The 1 second TTL appears to be working when we test it here but we’ve had a remote site report sometimes getting stale content.

See if they can take a screenshot of DevTools, like you posted above. That should provide some clues to what’s going on.

1 Like