Tagged: web design

Bloomberg and New Yorker also protect their paywall with Javascript

Joins New York Times and BloombergQuint

Thanks to Modi’s slow Internet, I found yet another site taking forever to download. When the page finished downloading, the content of the article suddenly disappeared and paywall appeared. Now, Bloomberg is also confirmed to be using Javascript to protect its paywall.

A few months after I informed BloombergQuint, they implemented a real paywall with truncated content, instead of one protected by CSS. New York Times continues to be on Javascript security.

When you truncate content, search engines cannot find much value in the pages. These pages will not appear in the search results. CSS and Javascript paywalls continue to provide the content to search engines.

There is a simple alternative to all this. Like my website, use Javascript to lazy-load images, CSS, other Javascript files and content for sidebar, header and footer. Someone who disables Javascript will not see the images and miss out on formatting. Search engines will continue to index those pages.

Articles should be truncated and moved behind the paywall as they grow old. Their URLs should not be changed to retain whatever search engine mojo they have acquired. And, the meta tags for robots (in the HTML) should say “index,nofollow,nocache,noarchive”.

Update: I found that the New Yorker is also on Javascript security.

New York Times protects its paywall with JavaScript – BloombergQuint used CSS

Instead of promoting social media sites and writing click-baity articles using millennials, how about hiring some experienced journalists and programmers.

One of the advantages of having the Modi government’s slow Internet is that web pages take forever to download. I clicked on a link and this NYT page started downloading quite lethargically. For some time, I was able to read the article but when the Javascript gunk finished downloading the article suddenly got truncated and a floating panel asked me to register to read the article. So, I turned off Javascript and the article loaded in full. No registration necessary.

They say that the site is still free if you sign up but I was not going to investigate. With BloombergQuint, I had to write a GreaseMonkey script.

NYT paywall defeated by switching off Javascript

NYT paywall defeated by switching off Javascript


age

How to make your website serve pages faster?

I made this list for CNN but it might be useful for any website owner.

CNN source code message

HTML source code at CNN.com has a hidden message. CNN Labs team asks for more ways to speed up their website.

I am always on the lookout for junk-serving domain names that I can add to my OS hosts file and CNN provided a number of them. Browsing through their source code, I found a message asking for ideas to improve site speeds. The CNN Labs team has already implemented several speed improvement techniques such as CDN, DNS prefetching, aysnc loads, and code minifying, and were interested in anything developers curious enough to look into their code could provide. Here are a few that I came up with:

  • Load HTML first. Everything else should be loaded afterwards. When CSS and JS are loaded along with HTML, they will block the display of the page content for at least one or two seconds. To do it properly, pre-press static HTML pages from your CMS and serve those static HTML pages to your visitors. Don’t put your HTML content in a database and serve them using a server-side script every time some one requests an article. Static HTML pages are served without any server-side processing latency. Like an image file, static pages are copied to the browser without any processing. They will not be parsed and interpreted like a PHP or ASPX script. (Pre-compiled scripts may be faster but not as fast as a simple file copy to a browser response stream.) Use server-side scripts for what they were originally meant for – really dynamic stuff such as Ajax requests, database searches and changes, handling live data and processing form submissions.
  • Lazy-load Javascript files, CSS stylsheets, images and videos using Javascript code in the static HTML pages. (My unreleased CMS does these two things already – check out www.vsubhash.in. While this CMS is targeted at people with personal websites, these two ideas can reduce waiting times for any kind of website.)
  • Don’t use custom fonts that get automatically downloaded from your website or even the Google fonts repository. (CNN uses its own “CNN” font.) Use a universal font stylesheet instead. Browsers can render web pages faster if they can use fonts already installed on the device. Does that make your webpages appear differently on different devices? Sweet mother of God! How will you survive? Really? No, sir, we don’t think pay attention to your corporate/branding font. It barely registers on our minds. If you are serving English text to an English audience, you don’t need a custom font. Custom fonts are meant for languages that don’t have universal device support or if the text is in a non-Unicode non-standard encoding tied to some legacy font. The need to display bar codes on a shopping site is a good use-case for a custom font. Emojis are not. Your EOT font download is likely to get stuck with all the other junk your page is downloading simultaneously. The visitor sees blanks everywhere in place of text, wondering what has gone wrong. Is that good for your corporate image? Don’t shock the user. Please read about the Principle of Least Surprise (PLS).
  • Don’t think people with enough bandwidth will have no problem. Whether you are on a PC or a mobile device (good Linux computers exempted), there are hundreds of processes that are forever talking to base and downloading/uploading files and data. Your webpage is competing with that and other tabs already opened in the browser. (Google’s policy states that Android will be talking to base, even if no app is running, even if it is in sleep mode, even if you have turned off wireless… So, imagine the situation when the device is being actively used.)
  • Don’t use images when the same effect can be achieved by CSS. But don’t use a CSS or Javascript framework when a simple image would do.
  • Don’t use a third-party CMS or big Javascript frameworks for your high-traffic website. This kind of software suffer from code bloat as CMS developers try to cram more features or try to make certain features work in all situations. Write your own CMS with custom Javascript and CSS optimized for your website. Maximum control & efficiency should be the goal. (CNN web pages, typical of off-the-shelf CMS-driven websites, contain a ton of JS and CSS and very little HTML.) Another problem with popular CMS programs are that site admins well-versed with them are not easy to find. Even if you do find them, it may be difficult for them to determine what a piece of code is doing. You will eventually end up hiring developers who can add extra or customized functionality over the CMS-generated Javascript and CSS. Good developers will write their own code. Lazy ones will resort to using more third-party CMS plugins. Over time, the code bloat will get beyond control. Very few developers in the Web team will be familiar with the site’s code and be able to troubleshoot effectively. Look at the dysfunctional MSDN (msdn.microsoft.com) site. There was never a proper plan. Over decades, different teams used different in-house CMS systems. They were numerous failed attempts to bring order to the whole mess. MSDN blogs used to be a popular thing. One day, someone, probably a suicidal maniac, decided to delete them. They tried to archive the blogs at their old location but botched it, resulting in millions of broken links. Despite all this, everytime you visited the site, there was an annoying survey popup asking about your impression of the site. Man, their increduluous audacity…
  • When you use ad networks, it is inevitable that you lose some control. However, you:
    • can load their script asynchronously (as CNN has already done).
    • ensure that their code is within limits. Many ad networks download a ton of (the same) Javascript libraries to do the simplest of things.
    • do not use more than one ad network in one page serving. You can rotate different providers on different browser requests. If you hit so many third-party sites for one request, as CNN does, what efficiency will you achieve?
  • Don’t use autoplay videos, even if you are a TV news channel. Are you misrepresenting video plays to advertisers? What? Top tech companies do it as well? Well, it is not a matter of just ethics but money too. Be assured that autoplay videos are a waste of bandwidth when the visitor just wants to read your article or is already listening to music. Even with the inflated statistics, you will still lose money… over time.
  • Why use a third-party service to serve related articles from your own site? Do it on your own. Ensure that your articles are tagged and categorized appropriately and serve their links on the sidebar, ordered by date and/or popularity. Add some AI and make it work. Ensure that this “related” stuff is not part of the static HTML churned out by your CMS. Lazy-load related content as well.
  • Limit the number of redirects in the links you post online. CNN links on Twitter pass through a maze of domains before settling down. These hops are time-consuming because they are on a https connection. Here is a list of redirects for one of their links (https://cnn.it/2DtZSme).
    • t.co (Twitter) to cnn.it
    • cnn.it to bit.ly
    • bit.ly to trib.al
    • trib.al to www․cnn.com
    • www․cnn.com to edition.cnn.com
  • Is your website accessibility-friendly? When you create an accessible website, you create a fast website by default. If you see more CSS+JS than HTML in a ‘View Source’, then your site is not accessible. It is not search engine-friendly either. Single-page websites are the creation of the Devil.
  • Don’t use pages that automatically reload. Are you a moron? (Not you, sir/madam, but I can list a dozen websites, a prominent news aggregation site among them, that do this without shame and this question is rhetorically addressed to them.) Use Ajax unobtrusively to change only the updated content.
  • Understand the principle behind Ajax. You display a page first and then use Ajax to inject data into it without reloading. Gmail does this in reverse. It will make you wait while it loads several megabytes of XML data, containing all your emails, before it displays your inbox – totally defeating the idea behind XML requests. Load what is needed, not everything from the beginning of time.
  • Don’t use social media plugins as-is-where-is. They usually block the loading of the page. Study their no-script versions and use your Javascript to generate valid links dynamically.
  • Analytics code increases bloat , reduce the responsiveness of the site and increases bandwidth usage. Do you really need them? There are many free server software that can process server log files and generate insightful visitor stats. Check your CMS or ask your hosting provider. If you need to study click-intensive regions for improving site effectiveness, use them on a temporary basis and get rid of it once you have generated enough data.
  • Don’t think that as Javascript engines are so fast, browsers will have no problem with all the gunk you have included in your webpages. Nah-hah! Javascript engines may claim to be fast but HTML and CSS rendering is still slow. Don’t believe me? Check out my Javascript benchmark test. After that, add network latencies (over which you have no control) to the mix and judge for yourself.
  • Over time, your pages will become overweight and be lethargic. Either give your site a redesign or start afresh. If not, do regular weight trimming. Measure the dry and wet weight of a web page. Is it really worth it? Regular code reviews help identify parts that are no longer required and provide ideas to optimize CSS and JS.

BloombergQuint protects its paywall using a CSS filter!!!

They are selling one-year subscription for Rs. 3000.

I mailed BloombergQuint a few days ago but they don’t care. They seem to think that even if someone figures this out, it is still a hassle to do this on all pages. I have a GreaseMonkey script that does this automatically on all their pages. Not that I read the site every day.

Open the browser’s console and disable the fuzzy container’s filter and the page’s content is visible.

BloombergQuint is one of the few remaining independent news organizations. The Quint was in the news recently when Modi govt raided their offices after some explosive Rafale deal-related stories and IT officials were found cloning the contents of journalists’ phones and computers.

It seems that their subscribers’ support is thin.

HTML Color Table – A PDF chart with all HTML color names and codes

MSDN Library used to have a page titled “Color Table”. It’s been lost in the slipshod archival process that the Big Data and Artificial Intelligence (AI) “leader” Microsoft followed. Here it is restored in all its HTML glory.

The PDF version is available at

Click to access html-color-table.pdf

aliceblue
(#F0F8FF)
antiquewhite
(#FAEBD7)
aqua
(#00FFFF)
aquamarine
(#7FFFD4)
azure
(#F0FFFF)
beige
(#F5F5DC)
bisque
(#FFE4C4)
black
(#000000)
blanchedalmond
(#FFEBCD)
blue
(#0000FF)
blueviolet
(#8A2BE2)
brown
(#A52A2A)
burlywood
(#DEB887)
cadetblue
(#5F9EA0)
chartreuse
(#7FFF00)
chocolate
(#D2691E)
coral
(#FF7F50)
cornflowerblue
(#6495ED)
cornsilk
(#FFF8DC)
crimson
(#DC143C)
cyan
(#00FFFF)
darkblue
(#00008B)
darkcyan
(#008B8B)
darkgoldenrod
(#B8860B)
darkgray
(#A9A9A9)
darkgreen
(#006400)
darkkhaki
(#BDB76B)
darkmagenta
(#8B008B)
darkolivegreen
(#556B2F)
darkorange
(#FF8C00)
darkorchid
(#9932CC)
darkred
(#8B0000)
darksalmon
(#E9967A)
darkseagreen
(#8FBC8B)
darkslateblue
(#483D8B)
darkslategray
(#2F4F4F)
darkturquoise
(#00CED1)
darkviolet
(#9400D3)
deeppink
(#FF1493)
deepskyblue
(#00BFFF)
dimgray
(#696969)
dodgerblue
(#1E90FF)
firebrick
(#B22222)
floralwhite
(#FFFAF0)
forestgreen
(#228B22)
fuchsia
(#FF00FF)
gainsboro
(#DCDCDC)
ghostwhite
(#F8F8FF)
gold
(#FFD700)
goldenrod
(#DAA520)
gray
(#808080)
green
(#008000)
greenyellow
(#ADFF2F)
honeydew
(#F0FFF0)
hotpink
(#FF69B4)
indianred
(#CD5C5C)
indigo
(#4B0082)
ivory
(#FFFFF0)
khaki
(#F0E68C)
lavender
(#E6E6FA)
lavenderblush
(#FFF0F5)
lawngreen
(#7CFC00)
lemonchiffon
(#FFFACD)
lightblue
(#ADD8E6)
lightcoral
(#F08080)
lightcyan
(#E0FFFF)
lightgoldenrodyellow
(#FAFAD2)
lightgreen
(#90EE90)
lightgrey
(#D3D3D3)
lightpink
(#FFB6C1)
lightsalmon
(#FFA07A)
lightseagreen
(#20B2AA)
lightskyblue
(#87CEFA)
lightslategray
(#778899)
lightsteelblue
(#B0C4DE)
lightyellow
(#FFFFE0)
lime
(#00FF00)
limegreen
(#32CD32)
linen
(#FAF0E6)
magenta
(#FF00FF)
maroon
(#800000)
mediumaquamarine
(#66CDAA)
mediumblue
(#0000CD)
mediumorchid
(#BA55D3)
mediumpurple
(#9370DB)
mediumseagreen
(#3CB371)
mediumslateblue
(#7B68EE)
mediumspringgreen
(#00FA9A)
mediumturquoise
(#48D1CC)
mediumvioletred
(#C71585)
midnightblue
(#191970)
mintcream
(#F5FFFA)
mistyrose
(#FFE4E1)
moccasin
(#FFE4B5)
navajowhite
(#FFDEAD)
navy
(#000080)
oldlace
(#FDF5E6)
olive
(#808000)
olivedrab
(#6B8E23)
orange
(#FFA500)
orangered
(#FF4500)
orchid
(#DA70D6)
palegoldenrod
(#EEE8AA)
palegreen
(#98FB98)
paleturquoise
(#AFEEEE)
palevioletred
(#DB7093)
papayawhip
(#FFEFD5)
peachpuff
(#FFDAB9)
peru
(#CD853F)
pink
(#FFC0CB)
plum
(#DDA0DD)
powderblue
(#B0E0E6)
purple
(#800080)
red
(#FF0000)
rosybrown
(#BC8F8F)
royalblue
(#4169E1)
saddlebrown
(#8B4513)
salmon
(#FA8072)
sandybrown
(#F4A460)
seagreen
(#2E8B57)
seashell
(#FFF5EE)
sienna
(#A0522D)
silver
(#C0C0C0)
skyblue
(#87CEEB)
slateblue
(#6A5ACD)
slategray
(#708090)
snow
(#FFFAFA)
springgreen
(#00FF7F)
steelblue
(#4682B4)
tan
(#D2B48C)
teal
(#008080)
thistle
(#D8BFD8)
tomato
(#FF6347)
turquoise
(#40E0D0)
violet
(#EE82EE)
wheat
(#F5DEB3)
white
(#FFFFFF)
whitesmoke
(#F5F5F5)
yellow
(#FFFF00)
yellowgreen
(#9ACD32)

* – Embrace, Extend and Extinguish strategy.

Dear web designers, it is time to update your favicon to 128×128! Forget about Internet Explorer 6 support!

Internet Explorer, when it came on the scene, started calling bookmarks (lingua netscapa) as Favorites (without the U). It also got web developers wrap a 16×16 image named favicon in a proprietary image format called ICO. You had put the icon in the root folder. Screwed if your pages were hosted on a directory on a free site such as Geocities or Tripod. When you added a new “favorite”, this icon was retrieved from the website’s root directory and added as the icon for the favourite’s menu option. Later, other browsers started supporting it. Then, there was a link tag and you had more freedom where you kept the icon or what format it was in. Well, that was all in the bad old 90s, right? Last century.

We are now living in a different world. Several mobile phones in the market have 8 cores when most desktops are lucky to have 4 cores or more. It is time to increase the size of the favicon. Some already have but most are still sticking to their 16x16s. How many people are still on IE 5.5, the last great IE version.

Look at the popular developer site, StackOverFlow.com. Its favicon is still at 16×16. Backward compatibility is important but this is ridiculous.

You can barely find the StackOverFlow favicon. It is super-backward-compatible with all graphic browsers known to man. I think it is time to move on.

You can barely find the StackOverFlow favicon. It is super-backward-compatible with all graphic browsers known to man. I think it is time to move on.

Unfortunately, Facebook’s favicon is in with the times.

Unfortunately, Facebook’s favicon is in with the times.