Edge caching implementation for url

What is the name of the domain?

example.com

What is the issue you’re encountering

Edge caching implmentation for url

What steps have you taken to resolve the issue?

we are trying to implement the edge caching for particular path like https://example.com/a/* for 2 min means it will serve the content to user from cloudflare edge server and edge server will revalidate the content every 2 min from origin server.for that i have use cache rule and followed the below steps

  1. Cache Rules > Rule name (required) > Custom filter expression > Field = URI > Operator = contains > Value= https://example.com/a/*
  2. Cache eligibility (required) > eligible for cache
  3. Edge TTL = selected > Ignore cache-control header and use this TTL , Input time-to-live (TTL) (required) = 2 min , rest of the setting is unchanged.

But after implmenting the same , when i checked the url under Cf-Cache-Status:DYNAMIC means it is still following the default cloudflare behaviour ideally it should be HIT under cf-cache-status and also want to know how can we know what is the edge cache time for static content like js,css, jpeg and is there any mechanism to know this via browser.

Cache rules doesn’t use wildcards (yet) and URI is not the correct field to use (look at the example text below the box).

Try URI Full - starts with - https://example.com/a/ instead

1 Like

Thanks @sjr also how can i know whether the particular static file or url is edge cached for how much time and what is edge caching time for cf-cache-dynamic?

Hi @sjr I have tried the above solution but it is not working. Please find the below SS and url for the same as i am still observing the Cf-Cache-Status as Dynamic only. Kindly suggest what need to done or what steps i am missing over here


Missed the url @sjr https://stage-abpapi.ttef.in/api/v2/page/article

You still need to remove the * from your rule.

Also, 2 minute Edge TTL is only available on business plans or higher.

Thanks @Laudian what if i want to make any url after https://stage-abpapi.ttef.in/api/v2/ should be cached for 1 hrs in pro and 2 min if i switched to business plan then what steps i need to follow because there will be multiple path after /api/v2/articles/ or /api/v2/stories/ like this. kindly suggest

1 Like

Your Rule looks good, just remove the * from the end.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.