How cached information is maintained by IPFS

Hello guys,
When a node requests a file by its CID, that node will cache it temporarily, But how the network knows this file is cached by the new node? Is the DHT updated when I have requested the file or another way is used to maintain this information?

Unless changed in the settings, once the node gets a file it starts announcing that it now has the file.
This means that it is cached and provided to the network until the garbage collector runs.

Is this helping?

1 Like

I’m aware of caching the requested file once downloaded by requester.
I’m asking how the index is maintained? for example, the requester will send a notification to the node that is responsible for that part of DHT and ask for updating the index of the particular file or there are some other ways used in IPFS?

AFAIK it dependes on the settings for Discovery:
Check this:

I’m not talking about node discovery, I ask about the cached file! How the index is updated when file gets cached?

Han not a clear idea, but I hope that the Discovery section will help anyway: there is a Routing option there that maybe is what you are looking for.

Since I don’t know, if you find out let me know here. Maybe you can check the code too!

It’ s controlled by the providing strategy. By default all stored data is announced on the DHT.