How clouldflare speed up my request and save my bandwitdh only if I just set up my domain?

cdn
cache

#1

I just set-up my new domain and add a DNS’ A record to my server. then I run a script of API requests. all the requests seem good, the HTTP response header only shows CF-RAY and no CF-Cache-Status as expected. You can think it of an API with dynamic content.

However, when I check my domain’ Overview and Analytics Page, I found out that there are some kinds of data being cached and saved me a few bandwidths.

I didn’t set up any cache page rules, and the test API’s response header is as below:

  1. Accept-Ranges:

bytes

  1. CF-RAY:

49a5bdbd4725989b-LAX

  1. Connection:

keep-alive

  1. Content-Length:

13

  1. Content-Type:

text/plain; charset=utf-8

  1. Date:

Thu, 17 Jan 2019 03:30:05 GMT

  1. Server:

cloudflare

  1. Vary:

Origin, Accept-Encoding

I just don’t figure out how Cloudflare saved my bandwidth, I think it should never cache this dynamic request.


#2

I don’t know about CF-Cache-Status and whether your API is the only thing that gets called through Cloudflare’s servers (think random Internet scans and crawlers)

But you don’t really seem to be sending any header that forbids caching, such as:

Cache-Control: no-cache, max-age=0

Also there may be savings in compressing responses (or compressing better than you, such as Brotli), or by upgrading responses to clients from HTTP/1.x to HTTP/2.

Those are the ones I can think of…


#3

No,I didn’t set any header to forbidding cache from Couldflare, But as the Cloudflare’s document says:

What if there no "CF-Cache-Status" header?

If the "CF-Cache-Status" header is missing (but you are seeing other Cloudflare headers such as "CF-RAY"), this can indicate that the resource is not something we would ordinarily cache. There is a list of file extensions we cache by default and you can utilise Page Rules to implement custom caching options (including static content and HTML).

So I suppose Cloudflare does not cache my request, but without caching my request, how Cloudflare saved my bandwitdhs?


#4

Requests other than the first request - such as files with extensions jpeg, png, css, js, etc. will likely save you some bandwidth.


#5

I did say that you didn’t. I suggested that you should (if that’s what you expect), because they might be cached, as nothing forbids them from being cached.


closed #6

This topic was automatically closed after 30 days. New replies are no longer allowed.