Nexus cache policies

Hello good people!

I want to ask a question. As far as we using Nexus it’s very great to have proxy repositories and cache packages inside of the Nexus for quick access them later. Great feature, thank Sonatype for that!

Question is: Can we configure somehow this cache policies?
I mean, for example:
PyPi proxy repository
Some package, let’s say awesomePyPi1.0.0.tar.gz
We use this package for our build and it was downloaded and cached inside Nexus.
A few days later new version of package was introduced and uploaded to a proxy repo with awesomePyPi1.1.1.tar.gz
And we still using this package in our build. What will happen when the code triggered to build? Will the cached version be in use or 1.1.1 will be downloaded and cached instead?
Second question: can we configure somehow time that cached packages are stored in global?(for example 1 week) and per repository?(for example: 1 week for PyPi and 1 month for NuGet?)
Can’t find this in documentation so if someone will provide me a link for that - that will be cool.

Hello,

Building against a Pypi proxies would work as if you were building directly against where ever you are proxying from (such as pypi.org). I am no expert on Pypi, but if you fix the version you are using in the build it should continue to use the previous one. However if you build requests the ‘latest’ it would find the new one, download and use that.

https://packaging.python.org/tutorials/packaging-projects/

https://help.sonatype.com/repomanager3/formats/pypi-repositories#PyPIRepositories-BrowsingPyPIRepositoriesandSearchingPackages

You can set cleanup policies against each repository separately to remove older versions. I don’t think there is a global configuration here.

  • “Policy setup may vary by format or repository and very likely varies per installation.”
    Cleanup Policies