For the past week or so, there has been ongoing work on server fine-tuning with regards to performance and a few other metrics like seo etc.
Google’s web.dev tool provides excellent insights and metrics on the fine-tuning. Presented below are results after about a week’s work on specific areas.
As is evident, ‘SEO’, ‘Best Practices’ & ‘Accessibility’ have pretty good scores.
Performance is hit by a few blocks which will be sorted out in the coming weeks.
This was not the case a couple of weeks ago when the respective scores were 27-55-69-85.
Unfortunately, data of the work-in-progress is not available since I had not bothered to collect and store it.
Henceforth, till such time, the site is tuned for optimal performance, there will be a weekly update on site performance and summary of the work done to achieve progress.
A summary of the work done
A summary of most of the work done in the past two weeks to improve the score is recounted below.
Best Practices
jQuery
Using an outdated version of jQuery was listed as a potential flag (for low score). The earlier version of the website used a bundled version of jQuery that came with ‘foundation’.
In order to address this issue, the latest version of foundation for sites was downloaded and the plain-vanilla version of the JS was integrated into the site. A custom shell script was written to concatenate all resource scripts in a specific order and then apply minification using minifyjs
tool. This ensured that future versions of jQuery can easily be updated without breaking compatibility with the existing version of foundation (hopefully). Plus this also reduces the number of scripts included in the template to just one.
Details of changes to the code are available in commit bcc1bc2
.
noreferrer
Outbound links (including those to subdomains) are now having rel="noreferrer"
attribute. This is apparently a best-practice advocated by Google (and MDN perhaps) and adds a layer of security to the site.
Miscallaneous
0f8b7f4
, 1546a8b
and 1bc54b5
addressed a host of accessibility, best-practices and SEO issues.
The markup image on featured content carousel was updated to use the latest standard (img with multiple src(set) to make the img responsive (optimal sized image best suited for the user’s display).
The logo on the top-bar was sized down appropriately which resulted in about 90% (300 Kb) reduction in file size.
Missing alt
tags were added to images. In some places where such alt
tags were not warranted, alt
attribute was added with quasi values like “icon” etc.
Some buttons, most notably the burger-menu icon did not have any text associated with it. Apparently, the text is needed by people who use screen-readers and this compliance issue was fixed by added the text “menu” and modifying the stylesheet to keep this invisible on normal browsers. The non-visibility of the text does not affect screen readers.
Issue with telephone numbers (links) and E-mail address being too close to each other and thus posing an issue of bleeding into the others’ click-territory was fixed by added __ padding and margin to each of the elements. While this may not seem to be a major issue on desktops and large displays, it is definitely a usability issue on smaller screens especially on devices two or more years old where in the user could accidentally click an adjoining link.
Work remaining
The performance still needs quite a lot of work to be done. For starters, a standard cache policy needs to be put in place for static resources like images, CSS, JS etc. Today morning, I had experimented by setting headers for cache through the htaccess
file which resulted in a nearly 65% increase in performance score (from 37 to 61). However for some reason, the score has returned to its previous place at 37.
SumoMe and Google Analytics are big guzzlers and warrant to be placed through JS (after page load).
Google is advocating the use of webP for images. Need to do research on sustainability of this format in the long term, given that JPG, albeit being less efficient than webP has been for decades and is universally supported.
॥ श्रीमते श्रीलक्ष्मीनृसिंहपरस्मै ब्रह्मणे नमः ॥