惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

www.infosecurity-magazine.com
www.infosecurity-magazine.com
月光博客
月光博客
IT之家
IT之家
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
博客园 - 【当耐特】
Recorded Future
Recorded Future
罗磊的独立博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 聂微东
Last Week in AI
Last Week in AI
S
Schneier on Security
Google DeepMind News
Google DeepMind News
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
AWS News Blog
AWS News Blog
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 叶小钗
Spread Privacy
Spread Privacy
The GitHub Blog
The GitHub Blog
MongoDB | Blog
MongoDB | Blog
P
Palo Alto Networks Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
T
Tenable Blog
A
Arctic Wolf
C
Cisco Blogs
S
SegmentFault 最新的问题
T
The Exploit Database - CXSecurity.com
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Martin Fowler
Martin Fowler
G
GRAHAM CLULEY
The Register - Security
The Register - Security
Project Zero
Project Zero
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Latest news
Latest news
J
Java Code Geeks
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
T
Threatpost
L
LangChain Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
腾讯CDC
I
Intezer
Schneier on Security
Schneier on Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org

jdhao's digital space

Conversion between base64 and OpenCV or PIL Image Search and Replace in Multiple Files in Vim/Neovim Change Table Column Width in LaTeX Image or Table Side by Side in LaTeX LaTeX 并排显示图像或表格 Firenvim: Neovim inside Your Browser Content inside HTML tags missing in Latest Hugo? Creating Markdown Front Matter with Ultisnips Labelme JSON 标注格式转 voc XML 格式 Nifty Nvim Techniques That Make My Life Easier -- Series 6 macOS 下如何为视频制作字幕 Running Command Asynchronously inside Neovim Resolving Merge Conflict after Git Stash Pop Pylint: command not found? A Hands-on Experience with Neovim's Built-in LSP Support How to Convert PDF to Images with Imagemagick 互联网上常用缩略语集锦 File Backup in Neovim Converting PDF Pages to Images with Poppler Nifty Nvim Techniques That Make My Life Easier -- Series 5 Neovim Configuration for System-wide Use How to sort a list of tuple or list in Python -- lambda or itemgetter? Building A Vim Statusline from Scratch 人类第一颗原子弹爆炸始末 Distributed Training in PyTorch with Horovod Learning Expect Programming Essential Knowledge about SSH Nifty LaTeX Techniques -- Series 1 更改 Adsense 邮寄地址,重新寄送 PIN Mintty Tips and Configurations Generating Table of Contents for Markdown with Tagbar Convert Python Script to Exe on Windows with Pyinstaller Ubuntu on Windows Missing after Windows Update 使用代理加速 Mac 终端下载速度 My Experience with Several Zsh Plugin Managers 深圳租房小记 How to Install zplug inside Docker Container Why don't settings inside bashrc or bash_profile take effect? Setting Up Locale in Linux 谷歌 Adsense 申请及在 Hugo 中的配置 How to Write Algorithm Pseudo Code in LaTeX Nifty Nvim Techniques That Make My Life Easier -- Series 4 A Few Grammar Questions in Writing How to Read and Write Images with Unicode Paths in OpenCV Creating A Professional Table in LaTeX with booktabs How to Create Proper Folding for Vim/Nvim Configuration Linux Tips and Tricks -- s1 JPEG Image Orientation and Exif How Do I Show the Current File Path In Neovim? JPEG Image Quality in PIL Difference between view, reshape, transpose and permute in PyTorch Convert PIL or OpenCV Image to Bytes without Saving to Disk Fast Movement and Navigation Inside Vim or Neovim Unintuitive Behaviour of Case Sensitivity in Python glob Binding Keys in Zsh 几把机械键盘试用体验 Nvim Autocompletion with Deoplete Converting Markdown to Beautiful PDF with Pandoc Exclusive and Inclusive Motion in Neovim/Vim Nifty Nvim Techniques Which Make My Life Easier -- Series 3 Why Doesn't Jedi Autocompletion Work for Some Methods Vim-like Editing inside Browser Markdown 生成 HTML 时汉字之间出现多余空格问题 小米 9 安装谷歌商店(Google Play Store)与相关配置 Create Mappings That Take A Count in Neovim Spell Checking in Nvim English Words Completion inside Neovim/Vim How to Use Python Inside Vim Script with Neovim Nifty Little Nvim Techniques to Make My Life Easier -- Series 2 Setting up Ultisnips for Neovim Mac 上罗技 M590 鼠标设置 Nifty Little Nvim Techniques to Make My Life Easier -- Series 1 A Complete Guide on Writing LaTeX with Vimtex in Neovim Manipulating Images with Alpha Channels in Pillow Sublime Text Regular Expression Cheat Sheet Cropping Rotated Rectangles from Image with OpenCV Boosting Your Productivity on Terminal with Zsh and Plugins 最新版 Rime 输入法使用 (2022 更新) Display Image with Pillow inside Ubuntu on Windows Faster Directory Navigation with z.lua Cmder Advanced Configurations Nvim-qt Settings on Windows 10 Tmux Plugin Install and Management How to Debug Python Code in Terminal Markdown Writing and Previewing in Neovim -- A Complete Guide Line Number Settings for More Efficient Movement in Neovim 两个大规模中文语料库介绍以及处理 Windows 系统下几款程序员不可不用的神器 我的 2018 阅读清单 A Complete Guide to Neovim Configuration for Python Development How Is Newline Handled in Python and Various Editors? Two Issues Related to ImageFont Module in PIL 在 Listary 中调用 GoldenDict 或欧路词典查单词 Reading and Writing Text Files on Windows The Mathematics behind Font Shapes --- Bézier Curves and More 快速识别图片字体:字体识别工具介绍 Deoplete Failed to Load at Startup after Updating Python neovim Package What Is The Difference between pip, pip3 and pip3.6 Shipped with Anaconda3? Windows 10 系统下 Neovim 安装与配置 How to Use shutil.move() on Windows and Linux
腾讯云对象存储博客图床开启 CDN 加速(不需要购买额外域名)
2020-03-16 · via jdhao's digital space

本文主要分享腾讯云对象存储开启 CDN 的方法,不需要购买额外的域名。

之前博文记录过把博客的图床从七牛迁移到了腾讯云对象存储,刚开始用腾讯云,觉得花费不算很贵,一个月不超过 10 元。直到有一次发了一篇关于机械键盘的文章,放了两张没有经过压缩的图片,由于访问人数稍微过大,几天时间就消耗了将近 40 元的流量费用。当时也在 V2ex 发了帖子,有人建议套个 CDN,因为 CDN 的流量相对于对象存储的流量更便宜。由于当时对 CDN 怎么使用不了解,以为还要自己再买一个域名,所以就没有深入了解下去。最近,趁着有时间,研究了一下博客的图床怎么使用 CDN,才发现原来设置很简单,也不需要购买域名。

设置 CDN 之前,需要理解几个相关的专业名词。

源站:简单理解,源站可以理解为最初的站点,由于这个站点的资源(图像,html,视频等)访问不方便,所以我们可以借助 CDN 来加速访问,减轻或者杜绝对源站资源的直接访问。相当 CDN 的节点服务器把源站的资料拷贝到自己的硬盘上,当有用户请求某个数据的时候,实际上访问到的是 CDN 的节点拷贝的数据。

回源:当源站的资料有更新,或者访问 CDN 节点缓存中不存在的某个资源,CDN 的节点会向源站请求更新的数据或者新的资料,这个过程就叫回源。CDN 可以设置回源时间,如果源站内容更新频繁,回源频率可以高一些,保证资料和源站一致,否则,回源的频率可以降低,减少对源站的压力和流量消耗。

回源鉴权:当 CDN 节点把源站的资料拷贝到该节点时,源站需要鉴定这些节点是否有从自己这里拷贝资料的适当权限,如果有权限,才可以拷贝资料。

腾讯云存储如何开启 CDN#

首先,找到自己存放图片的云存储的存储桶,进入以后点击「域名管理」,会出现域名管理的页面。由于我不想自己申请域名,所以选择设置「默认加速域名」一项。「默认加速域名」意思就是使用腾讯云的 CDN 提供的默认域名访问自己的存储桶里面的图片,这样用户就不需要额外申请一个域名了。

如果是第一次使用腾讯云的 CDN 服务,需要到 CDN 的控制台进行注册,注册以后,就会得到加速域名,下面的「源站域名」就是没有使用 CDN 的时候,访问我们建立的图床存储桶时使用的域名。这两个域名比较类似,只是把中间的代表存储桶区域的字符换成了 file,其余部分完全相同。在写博客引用图片的时候,应该使用新的加速域名来访问图片。如果一个图片之前的完整 URL 是:

https://blog-resource-1257868508.cos.ap-hongkong.myqcloud.com/test.jpg

那么该图片新的 URL 变成了:

https://blog-resource-1257868508.file.myqcloud.com/test.jpg

「加速地域」现在还不能选择,只能是「国内加速」,国内加速的含义是通过 CDN 节点来访问图片时,这些节点使用的服务器都是在国内,不论访问某一张博客图片的人位于国内还是国外。在这里,「源站」指的就是作为图床的这个存储桶,这是因为 CDN 节点上的图片其实都是来自于这个存储桶,或者当我们通过 CDN 提供的域名访问某个图片访问不到时,CDN 也会向这个源站请求图片。「源站类型」不用更改,选择「默认源站」设置即可。

如果存储桶设置的是公有读,那么下面的「回源鉴权」和 「CDN鉴权」不需要开启,否则建议开启「回源鉴权」。

保存这些配置以后,就会看到加速域名正在部署,过几分钟就会部署完毕。此时,进入腾讯云 CDN 的域名管理页面,可以看到已经添加了加速域名:

CDN 设置#

腾讯云 CDN 也提供了很多对域名的管理功能,在 「域名管理」页面,点击刚才配置好的域名,可以对域名配置进行修改。在 「访问控制」下面,可以设置 CDN 的防盗链功能,可以在 refer白名单下填上允许访问图片的域名,域名格式是一个模式一行,不用加 http://,例如,我的设置是:

jdhao.github.io
127.0.0.1

References#