Feature to allow downloads from http if available - proxy friendly but less secure
Original title: Make choco cache proxy friendly by trying to donwload packages from http instead https
If you have automated tests running every night, which prepares x virtual machines, which install x chocolatey packages, thus download many installers, it is at the end a lot of gigabytes that you download every night, and they are always the same gigabytes! A cache proxy in the middle would boost the performances exponentially, and chocolatey support already this feature, but alas cache proxies work with http but not with https, and now a days is very common that chocolatey packages include the https version of the download link of the installers, although the old good http version of the download link is also working. It would be very environment friendly if it would be possible to instruct vagrant to download the installers from http instead of https when it is available. In this case a cache proxy in the middle would be very efficient and would reduce the used bandwidth in internet, therefore the consumption of electricity and the emissions of CO2.
What proxing benefits from, so do malicious MITM types of clients. With a move towards more security and checksums in packages, this would only ever be available as a feature but not the default.
Updated the title
I was also experimenting with the cacheLocation, what would also solve the problem of the HTTPS URLs, but the cache location can't be shared between different devices. At least I was testing with two virtual machines using the same cache location, and once you install a package on one virtual machine, the second virtual machine finds the package in the cache and thinks that it has already been installed. In any case you can always force the installation of the package and then you have both virtual machines with the same installed package. Then you remove the package from one virtual machine and it deletes the package also from the cache, and the second virtual machine, which still has the package installed, thinks to not have it installed because it isn't anymore available in the cache and in that case you can't force the uninstallation either.
From what I understood the cache it is only for one device and it can't be shared with other devices, it is a shame, because it would have been a great feature.
cacheLocation is the downloaded resources, not the packages themselves.
I think you are talking of something else, trying to share the installation location and that is not a very good idea IMHO - you've already seen why that is.
Yes exactly, I'm looking for a way to cache the installers to not have to download every night 100 times the same files. From the name the cacheLocation seemed to be what I was looking for, a place where to cache files (packages/installers), so that many devices can get them from the cache without have to download them over and over.
I also looking for solution which avoid downloading the same packages again and again when we rebuilding docker containers / vm images. Docker solving the same issue without compromising security with caching registry. Maybe we could have something similar in chocolatey if you want to avoid http downloads?