Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with the problems of slow access to Github and slow loading of pictures

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge points of this article, "slow Github access and slow picture loading", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "slow Github access and slow picture loading problem" article.

It is well known that the access speed of Github in China has never been good. The main reason is that DNS parsing is too slow, that is, the process of obtaining IP from github.com is too slow. Therefore, one of the most effective ways is to modify the local Hosts directly and pass DNS parsing.

This is also the starting point of this article, although there are many such articles on the Internet, Baidu basically found the following routines:

Get the IP/ of github.com through IP parsing website and give some IP directly.

Modify local Hosts

Refresh the cache

Of course, one of the biggest disadvantages is that you need to modify Hosts every time you upgrade IP, which is very troublesome. Inspired by the warehouse, this paper provides a method of automatic modification, which is very convenient.

2.1 modify Hosts

First open the warehouse:

Copy the contents into the Hosts file. The location of the Hosts file for each platform is as follows:

Windows:C:\ Windows\ System32\ drivers\ etc\ hosts

Linux:/etc/hosts

Mac:/etc/hosts

Android:/system/etc/hosts

IOS:/etc/hosts

Modify the above files according to the corresponding platform and add the content to the end of the Hosts.

2.2 make Hosts effective

In most cases, the modification of the Hosts file will take effect directly. If it does not, you can try to manually refresh the DNS cache as follows:

Windows: open cmd and enter ipconfig / flushdns

Linux:sudo rcnscd restart

Mac:sudo killall-HUP mDNSResponder

If it doesn't work, try restarting the machine.

The above method requires manual modification of the Hosts file, which is very troublesome, and an automatic modification method is recommended here.

Before that, you need a tool: SwitchHosts.

3.1 SwitchHosts installation

The official warehouse is here, just go to Release to download it.

Or install it from the software package repository, take the author's Manjaro as an example:

Paru-S switchhosts-bin3.2 configuration

When opened, click the plus button in the lower left corner to add a new rule:

The contents are as follows:

Title: at will

Type: Remote

URL: https://cdn.jsdelivr.net/gh/521xueweihan/GitHub520@main/hosts

Automatic refresh time: you can select 1 minute for the first increase, and after you have the rules, you can select 1 hour

Once configured, you can see:

3.3 A small problem

During the actual measurement, the author found that if you start SwitchHosts directly through the startup menu, the addition of new rules always fails:

It doesn't work whether you enter the customer's password or the root password.

So the author looked for the startup command and started it directly with sudo:

Sudo switchhosts

Insert a picture here to describe

Failed to start, follow the reminder and add-no-sandbox (this is a parameter of eletron):

Sudo switchhosts-no-sandbox

It should be noted that you need to exit the SwitchHosts that was started in normal mode before starting, otherwise the port will be reminded to occupy:

After startup, you can modify Hosts directly without the need for a password.

Another small detail here is that the startup icons in the two modes (normal mode / sudo mode) are different:

Insert a picture description here.

After configuring DNS, you should be able to access the images on the Github:

The above is about the content of this article on "how to deal with slow Github access and slow picture loading". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report