Does Infura cache the same file

I’m trying to add two files into Infura “file1.jpg” and “file2.jpg”. Those files are the same inside. Infura return the same hash for each of them.
I need to receive different hash based on filename, not on bytes inside files. Help me, please.

Here a sample response:
{
“Name”: “1.jpg”,
“Hash”: “QmdEfgyyQcNbMa24jyM53tBYSFyRAVJ2gkWR2xofG8HPK2”,
“Size”: “138065”
}

{
“Name”: “2.jpg”,
“Hash”: “QmdEfgyyQcNbMa24jyM53tBYSFyRAVJ2gkWR2xofG8HPK2”,
“Size”: “138065”
}

Hi @Leksey_Nikitin and welcome to the Infura community!

Since IPFS uses content-based addressing; it creates an address of a file based on data contained within the file, when the files are exactly the same it will produce the same hash.

Please also check out a similar post here.

1 Like

Thank you a lot for your answer. I will change my code based on that knowledge.

1 Like