Tencent cloud using the cache provided for Nuget package manager Accelerator

Following Alibaba open mirror sites ( https://opsx.alibaba.com/ ), Huawei cloud mirror sites ( https://mirrors.huaweicloud.com/ later), Tencent has recently also on the line a similar service, the official name Tencent cloud software source (Tencent Open source mirror Site), to provide new software for the domestic developers mirroring select [ https://mp.weixin.qq.com/s/T43MZSDiN04EdgirBif1GQ ]. And other similar domestic similar services, this station provides open source mirroring the mainstream Linux distributions install image downloads and software source image, as well as several major language package repository services, such as Node.js and Python's npm warehouse and warehouse pip dotnet of nuget warehouse. Nuget mirror address ( https://mirrors.cloud.tencent.com/nuget/ ).

In Visual Studio 2013,2015,2017,2019 using a Nuget package manager to upgrade the management of third-party components. And Nuget we use an infrastructure of .NET Core, .NET package manager NuGet.org is a global user build service, regardless of user location, NuGet.org should have the ability to provide high performance of services. 2017 Microsoft Focusing on the problems China visit visit Nuget slow service optimization, the Blob storage and backup to local Chinese, and use local CDN service providers to handle the package download request, with specific reference to https://blog.nuget.org/ 20170907 / Changes-to-NuGet-dot-org-service-management-and-performance-improvements-in-China.html.

Nuget package API is divided into search, registration and storage of three categories. Which is most frequently used to register and store two types of API. Nuget image contains a reverse proxy cache to speed up the API. This image can be used and Tencent cloud application development acceleration effect can be achieved in the following:

  1. Search for packages : No acceleration effect . Search component package is provided by the additional domain names.

  2. Install, uninstall, upgrade packages, such as : full acceleration . All packages are by-day information cached on the server, each packet a day for the first time access to proxy access, then both local access

  3. Package installation, upgrade download the file : full acceleration . Each version of each package download micro proxy access for the first time, after all of the same version, the package ID are local access

Instructions:

Click "in Visual Studio 工具" - 选项" " left to find " Nuget包管理器" - 程序包源" " to confirm your list contains a version of the API V3 ( https://api.nuget.org/v3/index.json). Tencent cloud acceleration service only supports V3 version of the package source , without this record, you may not be able to use acceleration services, please upgrade your Nuget package manager .

5624069de6df7825bc826bdfd347e43

Click the Add button, and then enter the information below:

Once entered, click on the Update button to update, and finally confirm and close the configuration.

After setting the above, Nuget configuration file joined the relevant configuration file location: C: \ Users \ geffzhang \ AppData \ Roaming \ NuGet \ Nuget.config, which geffzhang my computer account, change your account below my Nuget sample configuration:

image

We are all above operations on windows 10, in particular, do develop .NET Core, many students like to use Mac, Mac and Linux if the path is, the path is ~ / .nuget / NuGet / NuGet.Config .

Note: NuGet.Config in Windows path% appdata% \ NuGet \ NuGet.Config, Mac and Linux path is ~ / .nuget / NuGet / NuGet.Config, if not NuGet.Config file, you can run dotnet restore command is generated.

The above configuration is a global configuration, if our project is to use continuous integration can be introduced Nuget.config in the project to be completed on Tencent cloud:

image

When you use dotnet restore can also be specified by using the -s Tencent cloud images, we will use this method to test the speed of the mirror Tencent cloud, I used to do two projects a simple test, the test results show that Tencent cloud mirror's speed or faster than the official.

Guess you like

Origin www.cnblogs.com/shanyou/p/11261216.html