Do you need a CDN for a blog

I find a lot of blogs use CDNs these days this made me wonder if they seriously need a CDN or is it just because they can get one. What felt weird was how personal blogs used CDN, where the content was mostly text. I believed strongly that they used CDNs because the website was powered by a heavy CMS or was served by a slow server, because of my previous experience of hosting on a slow shared hosting service and use of WordPress, thank you iPage for that experience. Now I use Digital Ocean, which offers VPS(Virtual Private Servers) called as droplet and gives you the option to choose from a wide verity of locations, so you can have a server close to you or your visitor.

It made sense to use a CDN with WordPress because of how there are too many clients sided files being loaded and it turns into an override from to infinity and beyond thanks to plugins and legacy code writing people.

What I found instead was even static sites used CDNs which was quite of a shock, because none of those sites were image heavy, they had quite lightweight client side scripts and stylesheet.

To such sites all a CDN would do would offer down time when the CDN service hit down time or had an issue with a specific instance that handled these clients files.

I wanted to research on why this was a trend and the results are quite interesting.

The reason

It is not a surprise that a lot of sites especially the new ones what to be more competitive and be part of the Alexa master race.

The main goal of these websites is to reach as wide of an audience as they can and will do anything to do so. The authors, publishers, and owners want to do any optimization in the client or server side without understanding if it is needed just because a click bait article describe to them using a CDN makes your site blazing fast while is true, it does not make the content or subject great.

In my opinion, a blog succeed when it has great content that is a good read and grows when such reads are served constantly. I think most people learn this only after a bit of an experience and will be misled and given wrong information till clickbait is the trend to get views.

I can understand a publisher’s mind they want to be out there and seen, noticed and seen some sites even personal blogs that turned completely clickbait just to gain views and immediate popularity, while other who had blogs gave up just because it got harder when it came to maintaining one and decided to shut it down when it was difficult. Yes, this is a sad reality, people give up too fast and want everything instantly.

When to use one

You might be already familiar with the concept to a CDN, if yes, then skip this if not then continue with the read.

A CDN has several servers or you can say instances in different locations and replicate the data from the provider(client) and replicate it onto those servers/instances, these serve then serve the content from the closest server to the visitor reducing the amount of latency and data travel on a given network. I have written a much [detailed post on this topic]

Example

Without a CDN

The server is in the US, the visitor is in Singapore, the visitor is served directly from the US server.

With a CDN

The server is in the US, the visitor is in Singapore, the visitor is served from the closest server which may be in Singapore or in some part of Asia, this means it is served by a server inside of Asia.

These days CDN services offer servers in many countries, letting the visitor be served by a server inside the country, for example, there can be servers in India that in both Mumbai and Delhi, so visitors of Mumbai will be served a server in Mumbai.

Do you need it?

If you have large amounts of posts or data being served and is large files or image heavy then you must go with a CDN otherwise you don’t need one if your server can handle decent traffic and the page load time is not very long

Multitasking leads to failure

In this age and time, we are surrounded by technology that was once a man’s dream and only part of Sci-Fi movies, now being part of our daily lives. Today our smartphone has a higher rate of processing power than all the computational power NASA had when man landed on the moon. Today we have this humongous amount of power at our fingertips and has given us some of the greatest advantages and has helped humanity to a very large extent.

Looking at it the other way is also interesting as it has done the same in the opposite. Today we have devices that can multitask and do a lot of things, handle messages while taking a high-resolution photo, download documents while watching a video, stream a live event or complete desktop. This has made us aware of the opinions of our near and far relatives, family, and friends that did not matter to us and we are seeing content that does not matter and have an information overload.

It has also resulted in a large number of people feeling that they have done work at the present and made them feel that they have not achieved much by the end of the day. This has resulted due to the access to information that one wants to learn about, other than when it would not be helping to accomplish the specific task he or she is doing at present.

An average person checks his smartphone for updates every once in twenty minutes and not being mentally present at that moment.

This also makes us less dedicated to our work and eats away our time.

Humans were never meant to multi-task, they are only good at doing that one thing at a time and that one thing was done very well.

Every day we decided that we should accomplish so much and fail. Due to this we go miles away from our goal and feel the time was not spent well.

We are not always aware that this is happening to us, you might be working on a document in your editor app and suddenly remember a video your friend was talking about the other day and instantly decided to watch that video, instead of finishing the document, just because the mind subconsciously finds tasks that have not been completed easier than the ones you are working on.

Later you realise that editing the document would take less than thirty minutes, but you ended up working on it for more than two hours, just because you sat there and decided let’s watch all the videos youtube recommended because they are only five minutes long, instead watched a whole playlist when you were supposed to go back and edit the document.

A study has shown that switching between multiple tasks instead of completing one, makes you feel mentally rewarded because your mind wants to work on easier takes and is fooled to believe, that it is easier to do other tasks than doing the current task, resulting in one checking his smartphone over and over again or opening the empty fridge doors to see if the tooth fairy has left some chocolates.

The only way one could fix this problem is by scheduling one’s workflow instead of scheduling one’s work itself. This will make us work on what we should be doing at present instead of what needs to be done. Resulting in doing what needs to be done at the moment and also by the end of the day you feel you have accomplished more, completed tasks, thereby browsing your smartphone or any other device more relaxed, because your mind is not prompting you into thoughts of what you should be doing and how much is left to do.

When to use a static site?

Static sites are great they don’t require a Database or pre-processors and they don’t require any complex server sided setup to get working. All you need is a web server that is set to serve a static folder. In the earlier days of the Internet, everything was static and had to be written because pre-processors and server side scripts were not a thing. At that time almost every web page had to be hand coded which was time-consuming. These days we have pre-processors and server side scripts which let us create websites, web applications with ease and has also reduced the amount of code we have to write this also has resulted in a lot of developers adopting DRY(Don’t Repeat Yourself). The static site still exists and are in use, but the real questions are Are they an overkill? When to use one? and How often is the content being updated matters Is it difficult to create one? The benefit over another type? Hosting?

Are static sites an overkill

Yes, if it is being used in a setup where a Database drove the website is doing fine and does not turn into a resource hog on a web server.

When to use one? and How often is the content being updated matters

If yes, then you how often? if the site is going to be updated every date or once in a week, it makes total sense to go static especially if you are a single user/admin. If the site is updated hourly or after certain minutes then it can remain static only till the updates are client sided why? because after a certain number of pages (150-1000) static site generators and website builds get slow and can be much slower if pre-processing of stylesheets and scripts are done. I would highly recommend going for a Database driven CMS if your website has multiple authors are multiple content publishing in such a senior a static site build would be more of a hassle and at some point turn unmaintainable as each author might end up having a different version of the same or different content.

Is it difficult to create one?

No, these days we have static site generators like Jekyll and many other popular static site generators that are well documented so a less knowledge person can also create a simple and fast website. Most of the static site generators like Jekyll ship with markup stylesheet and scripts pre-processors like Markdown, Sass, CoffeeScript that give you more control over your output. It is also lighter because it is a pre-rendered page which can be great for a high traffic website that does not update often especially when running on a low spec server

Benefits?

It is faster than a Database driven website because it does not require any server sided pre-processing or querying or doing any kind of fetching. It can be built on any system supported by the specific static site generator. It can be previewed locally much easily before being published to production. It is more like a filesystem, so it can be version controlled easily with the help of Git or Mercurial or any other DVCS tool.

Hosting?

All you need is the output of the static site and place it into the webroot even the most minimal web server can serve the website. GitHub offers GitHub Pages service that lets you host your websites on *.github.io domain, which is great if you want to have an open source website. It also offers Jekyll integration. Which makes it cheaper to host, which is great if you don’t want to spend a lot of money on. I would recommend that you do good research over static site generators and builders so you can find the right tool for your website. The other great benefit is Thank you for reading, Like always stay tuned for more content.

Everything you need to know about static sites

Static sites are websites that don’t use a pre-processor or backend service daemon or Database, these websites are purely written in client side languages like HTML, CSS, and JavaScript. It is one of the oldest ways of creating web content, but the popularity of it has dropped, which is not true, the popularity has dropped only in graphs that display, what tools are used to build websites.

Static sites are easy to create, if the right tools are used, it is a great way to build websites are serving web content, because it does not require any pre-processing of special setup, it can run on any base Web Server.

It takes a lesser resource because it’s just static files, no server side response or rendering to be done.

It has a shorter downtime and a faster response time, it does not require a Database to fetch content, so it doesn’t rely on a backend or Database. It is safer because Database and server side hacks don’t work on them.

There are many ways to create a static site, but only a few are beginner friendly, like Jekyll a blog-aware static site generator written in Ruby that uses Markdown of writing content and Liquid for logical templating, it has a well written documentation, that can be a very good place for beginners.

Jekyll is also one of the most popular static site generator and powers most of the GitHub Pages websites, it is not the only one, it’s just popular due to the functionality and simplicity it offers. here is a list of all the static site generators.

The good thing about these static site generators are, that there are so many of them, that offers various different functionality and features, written in various languages, they give you freedom and comfort to choose and let you choose it based on which language you know better.

So, you don’t have to stick to Jekyll, if you like Python, you can use Pelican or if you are Gopher(Golang coder) you can use Hugo.

Static sites are a good alternative, to Database driven and Flat File CMS.

It is a great choice, if you want to have a blog or portfolio, that does not need a fancy backend

Pre-processing can be done, when compiling files into static content, for example using of Sass or Less for stylesheets, use of Markdown for web content, logical templating for generating a difference in pages being generated. All the pre-processing that has to be done, is done while before or while compiling.

It can be dynamic too if you use dynamic, async client side scripts, you can fetch web content, dynamically.

The only downside is that it does not work for everyone, especially people who would like to use an admin interface, that can do things serve sided, like login and signup pages and front end editing for web content.

Apple Pencil: Why it needs to exist?

On 9th of this month Apple launched Apple Pencil an accessory for the iPad Pro. It is a stylus completely developed by Apple for the iPad Pro that offers pressure sensitivity and tilt detection, it runs on battery and is shaped like a pencil, it can be charged by the lightning connector that can be found at the other end of the device. You can charge it by connecting it to the iPad Pro.

After the launch of the Apple Pencil immediately, I could see all the hate towards it on the internet, with all kinds of people, specifically the Apple haters explaining, how bad the idea of the Apple Pencil was and those people were giving the Apple’s 2007 keynote as an example, which at that time made stylus seem an unnecessary input device for a smartphone.

What people did not think over, is how many things had changed from 2007 and how the iPhone had changed things.

Before the iPhone, all the smartphones shipped with a resistive touchscreen that required a stylus and ran an OS(Operating System) that was designed for devices that used a stylus, even the devices that only shipped with a touchscreen ran an OS that was designed for stylus use.

At that time no one wanted to make a touch-optimized OS, that doesn’t require any external input.

Apple launched the iPhone that made a big difference by offering what other smartphones did not offer.

Simplicity, all you needed was a finger.

Apple was not the first to make a capacitive touch screen smartphone, there were other manufacturers that made a smartphone with capacitive touch screen even before the iPhone, smartphones had existed with a capacitive touch screen but did not make a big impact due to lack of Applications and developer support and most of the devices ran stylus-based OS.

The iPhone was the only smartphone that made manufacturers develop better hardware and OS, just to compete.

After the success of iPhone, Apple launched the iPad which was another game changer, because of the way it changed how people looked at tablets.

Again, iPad was not the first tablet, before the iPad, there were tablet PC, but they ran OS designed for the desktop and had a bad tablet support, what you see today is a totally different thing.

All the tablet PC had to support pen input and touch was a nightmare because the OS was not optimized for your finger.

Microsoft tried hard to make Windows the tablet OS, but like always hardware manufacturers take software manufacturers seriously only whey fear that Apple will acquire their market due to lack of incompetent product.

Windows was doing well on tablet PC but did not achieve what the iPad did due to the lack of innovation in hardware, you cannot blame Microsoft for this, because if a hardware lacks features, the software will contain useless features that end up as a blot.

Until the iPad was out, no one wanted to manufacture a device that was similar to iPad and ran Windows.

Once the iPad started gaining market, manufacturers started making devices that ran Android, but not the version of Android you see today, it was the mobile version that was initially built for the smartphones and ran mobile apps on a larger display.

The iPad was the only device that had a correctly optimized OS that could run both iPhone and its own apps.

Tablet manufacturers started to take Microsoft seriously when they realized that Android was not the best alternative to do serious stuff and found Windows as a better solution.

Windows 8 changed the game of Microsoft and Windows user and encouraged business users to use tablets, the tablets that ran Windows was of better build quality compared to what Android tablet offered.

iOS had become a device for creatives, due to the number of apps available on the Apps Store for creative work.

Android soon started getting those same apps on their Play Store(earlier: Marketplace).

Artist and creative people started using iPad as a canvas to create digital artwork and sometimes that created digital masterpieces, for a lot of people it was a replacement from traditional tools and medium, while pen and tablets still existed, the iPad form-factor turned as a better choice for most.

It created the digital finger painting genre.

It was cheaper to buy an iPad than to buy a professional pen display, at that time pen display did not even support touch.

After this market grew it encouraged 3rd party accessory manufacturers to create a stylus that supported capacitive displays and replaced the finger with a comfortable pen-shaped tool, which was great for an artist who wanted the traditional feel, for some it replaced their pen displays and tablet PC.

The capacitive stylus lacked accuracy, it only could achieve the accuracy what your finger could achieve.

iPad Pro was shipping with a 5.6 Million pixel display, it’s now a bigger and higher resolution canvas for artists.

It is good to have a bigger, higher resolution display. The problem was that those 3rd party stylus/pen would not achieve the one-pixel accuracy.

So, Apple making a stylus for the iPad Pro was a corrective decision, looking at what has changed in the recent years, It is a new accessory for people who want accuracy, it integrates with the iPad Pro, which makes it less of an external input device.

Apple first makes thing that public would demand and later make thing on public demand

It is true that the Apple Pencil is expensive.

They developed it all by them self, which might be the reason for it to cost so much, the Apple Pencil is cheaper than a professional pen tablet.

If you don’t like the Apple Pencil, you can go buy a 3d party stylus or buy an Android tablet with a Wacom designed pen input. There are a lot of choices when it come to tablets and accessory, the Apple Pencil is not putting anything to end, its is just a good alternative

It is just giving users a better option which can give them better results.

Thank you for reading.

Leave a comment below and let me know your opinion.