Monthly Archives: September 2023

Mai bada hokar kya banunga?

(Note: This article is written in Hinglish, and requires the reader to know Hindi in addition to English)

Socha ek post Hinglish mai likh du. Whatapp aur baki saare apps pe dosto ke sath toh aise hi baatein hoti hai, toh phir iss blog pe kyu nahi.

Koi khaas aisa topic hai nahi mere pass. Saturday ko ek dost se baatein chal rahi thi, aur vo kisi baat pe mazak mai bola “Mai bada hone ke baad…” aur hass diya. Joke yeh tha ki bade toh already ho gaye hai, aur kitna bada hona baaki hai?

Usse milne ke baad jab ghar jaate jaate maine socha, akhir bade hue hi kab? Kab vo pal aaya zindagi mai jab hum sab bade ho gaye. Socha maine akhri baari “Bade hone ke baad…” kab kaha hoga.

Kuch khaas yaad nahi, par shayad college ke shuruvat ke saalon mai. Tabhi vo transition hota hai na, hum chahe jo vo kar sakte hai to humari placement hogi ya nahi. Shayad ussi wakt kaafi logo ke sapne chote ho jaate hai aur life ke boundaries thode jyada clear ho jate hai. Ussi ke sath responsibilities aa jati hai aur society ke set template pe zindagi aage badhti chali jaati hai.

Job, uske baad shadi, shayad bacche, agar naseeb hua toh ek acha ghar, gaadi. Bas yehi sab mai vo “bade hokar kya banana hai” wala savaal kahi dabb jata hai. Aur phir yuhi kabhi baaton baaton mai yaad aa jata hai vo saval, jo bachpan mai kitna aksar pucha jata tha.

Padhne ke liye shukriya!

Trying Cloudflare’s Automatic Platform Optimization

If you’ve looked at this blog’s theme repository, it wouldn’t surprise you when I say I’m obsessed with website performance optimization.

I admit that it almost feels like cheating boasting about performance figures of a website that has very few images, much less any other form of media. But that is what I have, so that is what I’ll try to optimize.

I came across Cloudflare’s Automatic Platform Optimization a couple of days ago while trying to move my website to a bigger EC2 instance on AWS. I was upgrading the EC2 instance mostly for the admin side of the website, which really struggled with image uploads, but this juicy piece of optimization was too good to not try and apply. At least temporarily.

What is Cloudflare’s Automatic Platform Optimization for WordPress?

I use Cloudflare for content delivery. Cloudflare, among the plethora of things they currently do (and do well), is a very good CDN. They have a more than adequate free plan for personal websites. For a website like mine, it means the CSS and JavaScript (and the occasional images) get served from a location closest to the visitor via Cloudflare’s edge network.

The initial request to the HTML file, however, is still served by my origin. There’s some caching in place so that not every request has to hit the database, but the content is still travelling to the visitor all the way from Frankfurt, Germany.

This is where Cloudflare’s APO comes in. It allows the entire WordPress website to be cached, including the HTML parts. What that means is that the initial request is served through Cloudflare’s edge cache and nothing touches my origin server.

Setup

Setup includes buying the appropriate plan on Cloudflare’s website. At the time of writing it is US$5 / month. The setup includes a WordPress plugin, which is fairly simple and minimal in customizability (not like there’s much to customize here). It does have an option to cache by device type and apparently it can purge caches upon site update, which is neat.

How does that look in practice?

Here’s an example of what it is that you get for the price. Below is the default duration for the initial document load of my blog’s homepage.

Turning on APO through the included WordPress plugin, we immediately see a huge 10x improvement. I believe at this point my own internet connection might also be a bottleneck. The cf-cache-status: HIT suggests that the HTML document was served through Cloudflare’s cache.

I am a bit unsure if this is possible to achieve using page rules within the free plan (it does look like it is to some extent), but APO also has the added advantages for WordPress.

In conclusion

I admit I don’t really need this optimization. My blog already scores full points on many website performance measurement tools (low-key proud writing this). I also admit that I find it extremely cool to do such things. In any case, hope the article was interesting. Thank you for reading.