(Mix between feature and support, thought best to post here)
When getting JSON data from an API with a very long url, the download runs fine, but if the cache path is too long, a ‘file name too long’ error is raised. I’m reasonably sure this is the OS not hugo, but this is certainly the right place to raise this!
Obviously this is a reasonably niche issue, but still one all the same, as my site wont build. Whilst i dont know how the cache for this works in hugo, I have come up with a potential solution.
If rather than using the full URL as the filename, you instead used a hash (doesnt matter which), then the filename will be far shorter, and a uniform length. Yes this does make finding a cache file much harder for a user, but for hugo to find it, it’s a minimal computational step extra.
Another alternative would be to store all cache items in a single file, but that feels a bit too weird, and would likely increase the memory footprint.
Open to suggestions, but saving the url as the filename just feels like a massive hack IMO.