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

推荐订阅源

宝玉的分享
宝玉的分享
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 聂微东
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 三生石上(FineUI控件)
T
Tailwind CSS Blog
Apple Machine Learning Research
Apple Machine Learning Research
Hugging Face - Blog
Hugging Face - Blog
爱范儿
爱范儿
博客园 - 司徒正美
人人都是产品经理
人人都是产品经理
Jina AI
Jina AI
博客园 - 叶小钗
雷峰网
雷峰网
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - Franky
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
阮一峰的网络日志
阮一峰的网络日志
量子位

James Guo’s Portfolio (@ZE3kr)

Hertz Rental Debt Collection and How I Sued the Debt Collector macOS on iPad? (with Jump Desktop) Vision Pro Initial Experience | ZE3kr The Downtime of Alibaba Cloud Hong Kong Region How Fast is mmWave 5G? 2000Mbps! See if Your iPhone Supports mmWave Magic Keyboard for iPad Pro Experience Self-built PowerDNS Advanced: GeoDNS, dnsdist, Lua Records SSD USB, Windows To Go and Mac WordPress 5.0 Update is Available, New Editor, New Theme Azure DNS, NS1, Constellix, Comparison of Three International GeoDNS Service Providers Recommendations for Some Exquisite and Useful Software on Mac Talk About Data Backup | ZE3kr Introduction to DNSSEC, How Signatures Work Cloudflare Argo And Railgun Comparison Test, The technology of CDN Acceleration Recommendations For Several Free Server Monitoring Services Comparison of Several Full-Site CDNs 2017, Another Look at SSL and HTTPS Some suggestions on website construction and service purchase Detailed Explanation of DNS Domain Name Resolution System - Basics Build Blazing Fast Mobile Pages With AMP Cloudflare's new feature experience - Load Balancing, Rate Limiting Back to WordPress' Built-In Comment System Implementing ECDSA/RSA Dual Certificate with Free Let's Encrypt How to configure for pure IPv6-Only network access Self-built PowerDNS GeoDNS Server | ZE3kr Install GitLab on Your Own Server Instead of GitHub! A Few WordPress Optimization Suggestions Comprehensive Comparison of DNS Services such as CloudXNS, Route 53, and Alibaba Cloud DNS Talk about the streaming of video on the Internet Canon Announces New APS-C Model EOS 80D, Powerful Video Recording, New Focus System and CMOS
The pros and cons of static web pages
2016-01-03 · via James Guo’s Portfolio (@ZE3kr)

Static web pages, that is, pure HTML web pages, each page in the blog is a .html file. First of all, there is a misunderstanding here. Some people think that static web pages cannot be easily updated. In fact, static web pages can be easily updated. With the help of static web page generators, updating them is not complicated. When it needs to update an article, it needs to regenerate the home page and the article, which is usually done in less than a minute. What if the blog were to use dynamic web pages? It is certainly possible to do so, and there are many mature software, such as WordPress, that run in a PHP environment and require a MySQL database. Every time a web page is accessed, the server needs to read the content of the database (or read from the cache), and then process it into HTML with a certain style and return it to the user. Of course, dynamic web pages can realize all the functions of static web pages, and of course there are more functions, such as image uploading and regular publishing. Since dynamic web pages can realize all the functions of static web pages, what are the advantages of static web pages?

Advantage 1: Save Server Overhead, not Afraid of Attacks

Not Afraid of DDOS Attack

After a lot of DDOS attack tests, I found that static web pages are much harder to attack than dynamic web pages, even one to several orders of magnitude harder. Every time you visit a dynamic web page, you need to parse PHP, read the database or cache, and require much more computation than static web pages. Therefore, the DDOS attack is basically ineffective, and the speed is not even slow.

Hard to be Hacked

A static web page does not need a database at all, it is just a file itself, so there is no problem such as database injection at all. There are even fewer bugs.

Simple CDN on the Web

CDN on static web pages is extremely simple, and site-wide caching is enough. Every page can be cached directly, and all caches are cleared when the page is updated. After you have a CDN, you are not afraid of DDOS. It is not a problem to attack the other party or even GB, and people just need to pay a few cents for the traffic fee.

Advantage 2: Simple Server Deployment

A static web page doesn’t need a database at all, it just needs a server that can upload files and link externally, such as Amazon S3 can put it. Most servers can deploy it.

Advantage 3: Simple Maintenance

Basically, as long as you know HTML, CSS and JavaScript, you will write static web pages, and then use some static web page generators to generate all the pages directly.

Problem 1: Update Real-Time

If a static page generator is used, there must be a delay, and the amount of delay depends on the speed at which the page is generated. There are two generation methods to choose from, one is to generate locally, the other is to generate on the server.

These functions can generally only be implemented in dynamic web pages, because they all require a database. However, static web pages can choose third-party services. For example, you can use Disqus for comments, Google Analytics for statistics, or You can build your own dynamic server to do these things and install Piwik.

Summarize

There is no problem with blogging with static web pages, and it is also recommended by me (slap in the face, I have actually switched to WordPress now). It’s convenient and simple, and there’s nothing wrong with it.