How does resources.GetRemote determine the path for the resource?

When I use resources.GetRemote to download https://images.unsplash.com/photo-1490604001847-b712b0c2f967?w=1296, it’s written to /photo-1490604001847-b712b0c2f967_8057969955919262989.jpg.

What does the “_8057969955919262989” suffix mean? Is that derived from the query parameter? If not, is there a way to have the query parameters be represented in the filename so different parameter values don’t clash?

Is there a way to have it saved anywhere other than in the site root, like with the associated page?

I couldn’t find the answers in resources.GetRemote or here, but I’ll update the docs with any answers I get here.

That number is a hash (xxhash) built from either

  1. The key set in options.
  2. the URL and any options

So, in the default case (no key set) we include any query parameters, headers etc. in the hash.

Thanks.

See content: Update GetRemote.md with resource save location by willfaught · Pull Request #3604 · gohugoio/hugoDocs · GitHub.