From the doc:
Cloudflare caches the resource in the following scenarios:
- The Cache-Control header is set to public and the max-age is greater than 0.
- The Expires header is set to a future date.
But I find it cached my js files, even when my nginx server doesn't send any Cache-Control and Expires header.
Cloudflare caches the resource in the following scenarios:
This is a bulleted statement from the first paragraph on this page which, as the beginning of this paragraph explains, applies to the case when there are headers sent by your server.
In other words, when there is a non-default case with the headers supplied by your server, Cloudflare treats the headers according to the bulleted points specified in the first paragraph.
But I find it cached my js files
When there are no headers (which you are referring to by saying "my nginx server doesn't send any Cache-Control and Expires header") then this is the default case and the second paragraph on the same page applies. It says that .JS files are cached by default.