转载链接:https://blog.csdn.net/qq_36589706/article/details/80573008
因为工作需求,自己会经常使用到github,但是突然有一天打开github时,发现css样式全没了,如下图,网速正常的时候也是这样,怎么办呢,趁着今天周六,闲下来了,就找找博客,终于解决了,记录一下~

场景重现:

网站响应缓慢,排版错误,图片加载不出。

以谷歌浏览器为例,F12打开开发者选项,可以看到如下报错信息:

可以看出,是Github需要在线加载的资源(css,js)文件未能成功加载

解决办法: 
为了提高速度,可以使用HOSTS加速对Github网站加载的资源网站域名解析。

具体做法:

修改 C:\Windows\System32\drivers\etc 中的hosts文件(PS:若没有修改权限,可以鼠标右键,属性,安全,修改权限。或者将hosts文件复制到桌面,修改之后,复制到原文件夹),将下面一段话添加到hosts文件中:

 # GitHub Start
192.30.253.112 github.com
192.30.253.119 gist.github.com
151.101.100.133 assets-cdn.github.com
151.101.100.133 raw.githubusercontent.com
151.101.100.133 gist.githubusercontent.com
151.101.100.133 cloud.githubusercontent.com
151.101.100.133 camo.githubusercontent.com
151.101.100.133 avatars0.githubusercontent.com
151.101.100.133 avatars1.githubusercontent.com
151.101.100.133 avatars2.githubusercontent.com
151.101.100.133 avatars3.githubusercontent.com
151.101.100.133 avatars4.githubusercontent.com
151.101.100.133 avatars5.githubusercontent.com
151.101.100.133 avatars6.githubusercontent.com
151.101.100.133 avatars7.githubusercontent.com
151.101.100.133 avatars8.githubusercontent.com
# GitHub End

  

保存hosts文件,重新打开Github网站,此时网站的访问应该可以恢复正常。

如果没有立即恢复正常,需要刷新DNS缓存,告诉电脑我的hosts文件已经修改。Windows下刷新DNS缓存的方法:进入命令行,输入命令:ipconfig /flushdns

最新文章

  1. 利用百度云免费备份SQL数据库
  2. 《Pro Git》阅读随想
  3. Struts2的模板和主题theme及自定义theme的使用
  4. js调用父窗口中的方法
  5. WPF自定义窗口基类
  6. C#中调用C++的dll的参数为指针类型的导出函数(包括二级指针的情况)
  7. Android常用动画Animation的使用
  8. aop编程 环绕round
  9. tomcat Server.xml Context配置
  10. C#仪器数据文件解析-RTF文件
  11. 笔记:Hibernate 持久化类标注说明
  12. SCOI2019酱油记
  13. php curl Problem with the SSL CA cert (path? access rights?)
  14. orcal - 增删改
  15. Oracle SQL调优记录
  16. 2014-2015 ACM-ICPC, Asia Xian Regional Contest(部分题解)
  17. SQL Server 本地数据库登录不上 解决方法
  18. echarts2 饼图处理标签文字过长使之达到指定字数换行的目的
  19. [转]What are mode and status columns under gp_segment_configuration table
  20. accumarray

热门文章

  1. 跨平台的WebRTC客户端框架:OpenWebRTC
  2. 洛谷【P3908】异或之和
  3. java中toString() 、(String)、String.valueOf的区别
  4. 在Altium Designer 2009下如何添加Logo图
  5. Dialog 自定义使用2(进度条)
  6. 02_android下单元测试
  7. [51nod1267]4个数和为0(预处理+双指针)
  8. p2921 Trick or Treat on the Farm
  9. 基于http的多进程并发文件服务器
  10. Spring入门第二十八课