博客反应太慢,为了解决这个问题尝试了不少方法,其中就有静态资源保存在七牛云上这点,这里介绍一下wordpress与七牛云存储的结合。
首先去创建一个七牛云账户,需要存十块钱认证,创建域名绑定,创建存储空间,免费10G足够用了吧~
然后设置存储空间的镜像存储,如图所示,填写你需要存储的域名
这里需要注意的是robots.txt这个文件,这是搜索引擎是否允许爬取的文件,为了防止K掉我们的站,最好在空间中添加这个文件,下面是为添加的内容
# robots.txt
User-agent: Baiduspider
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: Sosospider
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: sogou spider
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: YodaoBot
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: Googlebot
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: Bingbot
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: Slurp
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: MSNBot
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: googlebot-image
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: googlebot-mobile
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: yahoo-blogs/v3.9
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: psbot
Allow: /wp-content/uploads/*.jpg$
Allow: /wp-content/uploads/*.png$
Disallow: /
User-agent: *
Disallow: /
回到博客后台,安装七牛云存储插件,填写配置,这样就OK了,只要访问了网站,就会把访问的资源存储到七牛云上去提高访问速度~