Hi, @PabloRomanH. I can confirm that the response above was sent only once (Netlify does not reuse x-nf-request-id
values). It was sent 2023-02-12 15:30:51.245 UTC.
Netlify CDN did not cache that response. If it is being seen more than once, it is being cached elsewhere. My best guess is that it is coming from a local browser cache or some third-party service.
Note, Netlify CDN can cache URLs and, when On-demand Builder functions are used, it can even cache Function responses.
However, when our CDN caches those responses and serves them again two things are always true:
- our internal access logs include a field called
cache
which will state if the response was served from the cache or the origin
- the
x-nf-request-id
will change for each cached response (even cached responses do not reuse those values - that value is never cached by Netlify)
I can tell from our logging that 01GS34067DYNTHF9K0NCHEX1JH
was not a cached response. It was a cache miss and it was served from a new function invocation.
Again, even if this had been an On-demand Builder function (and it was not) and even if it had been a cached function response, the same x-nf-request-id
header would not be sent again. Even if it was cached, the x-nf-request-id
would change for each and every cached response. The response body would remain the same but that header would be unique for each and every HTTP response.
To summarize, if you are seeing those responses re-used, they are not originating from Netlify. The caching is most likely the local browser but could also be some third-party service not controlled by Netlify.
The user-agent for the x-nf-request-id
you shared was this:
Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.5414.101 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
It is the (compatible; Googlebot/2.1; +http://www.google.com/bot.html)
at the end that jumps out at me. This header can indicate a bot that has the job to create a “card” for a URL (card = a rectangle containing an image and some text that show more information about the URL in question). These cards are used in social media and replace the URL being posted. Often those third-party services will cache the card itself. It could be that this response was scraped by some bot and being cache by that service itself. I have no idea if that is actually happening but it is a possible scenario based on the user-agent.
Again, all I can say for certain is that the caching isn’t happening at Netlify. I believe you that something is caching those responses. However, I can assure you it is not Netlify doing it.
There is one more way to prove if Netlify is caching the response or not. (I know we are not and I want you to be able to see the proof yourself.) The proof is the answer to this question:
- What is the IP address that responded with the cached response?
The x-nf-request-id
header is what we normally use to identify a specific HTTP response (because the header is a unique identifier). However, if you don’t want to use that header, the following information is needed to identify a single HTTP response:
- the client IP address making the HTTP request
- the server IP address that responds
- the full URL being requested
- the date, time, and timezone when the response occurred
If you send us that information for an incorrect response, we can track it to see if it is Netlify or not.
You can also test yourself by replacing the IP address in the example below with the IP address that responds:
$ curl --compressed -svo /dev/null https://50.18.142.31/ 2>&1 | egrep 'subject:'
* subject: C=US; ST=California; L=San Francisco; O=Netlify, Inc; CN=*.netlify.app
The IP address above is 50.18.142.31
and the SSL certificate is Netlify’s. If you replace that with an IP address which is not Netlify’s you will not see our name. For example:
$ curl --compressed -svo /dev/null https://8.8.8.8/ 2>&1 | egrep 'subject:'
* subject: CN=dns.google
So, once you find the IP address returning incorrect responses, we will know if that is Netlify’s IP address or someone else’s. (Now, I have a list of our IP addresses so I can also check that way. However, the curl
method above can be used reliably without access to our IP address lists.)
Please let us know if there is anything else we can do to assist with troubleshooting this issue.