Optimizing Your Website for Performance, SEO and Social Sharing

With the advent of Artificial Intelligence, those who use AI daily are often reluctant to search on Google to go to a specific website. We ask ChatGPT, Bing Chat, Claude, and BARD most of our questions. But this is yet to be the norm in the world. Besides, more and more of these LLMs are getting access to the internet, and they need to access websites. So, humans may not directly consume websites in the future; But our AI assistants will need information to help us, and therefore, creating websites still makes sense. This is because most of the world will not suddenly get access or switch to AI in the next few years.

Recently, I created my website, mjkabir.com. I had a single-page site for years and never cared much about it. Then, I realized a simple trend on Twitter. People who check out a user's profile page often click on the link in the profile to learn more about the person they are interested in. However, if the link looks long or complex or like their company, people are often reluctant to click on it. 

I used to have cprompt.ai in my profile. I hardly got any clicks on the link. Then I switched to mjkabir.com, and even on the first day of the site launch, I got a subscriber for the newsletter from the profile page's link. People are willing to click on a personal website more than a company website to learn about someone they are interacting with on social media.

As I created this custom website from scratch, I checked off all the best practices and optimizations needed. In this article, I will share the site audit process for performance, SEO, and social sharing so that you can benefit from these tools if you are creating a new site for your personal or business use.

Note: I am not affiliated with any of these tools, so no worries. They are primarily free anyway.

Audit Your Site

Once you have a site created and launched, hopefully in beta mode, you can use many online tools to analyze your site's performance from various perspectives. There are many tools to use, but I will share two here.

PageSpeed Insights

This is a free tool from Google that you can use anytime. Just point to your site's URL and click a button to analyze the performance of your website. It is simple and perfect in its analysis. Here is the site:

https://pagespeed.web.dev

I have created a video showing the scores it gave mjkabir.com, which is very decent, and I was delighted with the results for both mobile and desktop modes.

GTmetrix

I also use this performance analyzer when interested in a  second opinion about my website's performance. Here is their site:

https://gtmetrix.com

As you can see, mjkabir.com also got excellent scores on this tool.

https://gtmetrix.com/reports/mjkabir.com/bMIW9E26

If you are not getting good scores, you can easily dig deeper into the problems and potential solutions with their explanations. Typical oversized items to be mindful of are:

  • Page load time - the number of images, external javascripts or CSS files, or videos can cause your page to load slow
  • Image sizes - if you have a lot of images, be mindful of the time it takes to load. Use lazy loading concepts if possible. 
  • Meta data - make sure you have at least the minimum metadata in the HTML to get good SEO scores
  • OpenGraph data - sharing your site content with social media depends on the OpenGraph settings. We discussed next.

Social Sharing Audit

If you care about people sharing your website's pages on social media and want the embeds to look good, you must pay attention to the OpenGraph elements in your HTML markup tags. Head over to the site below and test your OpenGraph metadata:

https://www.opengraph.xyz/about

You want to ensure your pages have all the relevant OpenGraph metadata entered. Here is what it looks like for mjkabir.com:

 And here is what mjkabir.com links look like when posted on social media. Here is how it will look on 𝕏 (formerly Twitter)

Here is how it looks on Facebook:

As you can see, the link includes a picture from the page, which makes the embed more visually attractive.

Speeding Up with HTTP/2

HTTP/2 is a newer, faster version of the HTTP protocol that powers the web. It was created in 2015 to help pages load more quickly. HTTP/2 allows for better multiplexing of requests, header compression to reduce overhead, and server push of content before it's requested. In basic terms, HTTP/2 enables web servers and browsers to communicate and exchange information more efficiently. This results in faster page loads, less latency, and a smoother browsing experience for users. The transition to HTTP/2 is happening behind the scenes as major websites and platforms adopt it to speed up their services.

Enabling HTTP/2 on your web server is a great way to speed up your page delivery. Here is an example of Nginx configuration to allow HTTP/2:

# Enable HTTP/2

listen 443 http2 ssl; 

HTTP/2 allows for more efficient use of connections and can improve page load speed.

Google Analytics vs Other Options

For analytics, most people default to Google Analytics.  However, the Austrian Data Protection Authority has ruled that transferring data from the EU to the US via Google Analytics is illegal, prompted by 101 complaints filed by privacy group noyb after a 2020 EU court decision invalidated the EU-US data transfer agreement over inadequate protections against US government surveillance. This landmark ruling against the industry standard web analytics tool used on millions of sites worldwide is expected to be followed by other EU countries, aiming to force US tech companies to adapt to EU privacy laws rather than circumvent them. So we do not use Google Analytics on sites that we control directly like this domain or CPROMPT.AI.

There are privacy-focused alternatives you may want to consider instead. I am using Pirsch.io on this site. Here is there link:

https://pirsch.io

There are other options like Plausible from plausible.io which is open-source and lightweight. Even though I am big on open source solutions, I just don't like OSS software that require docker-based installations. Also, for a small price, I can use Pirsch on unlimited websites from the same account. The choice depends on your needs, but it's worth evaluating alternatives to Google Analytics if you want to limit data collection and respect visitor privacy.


There are tons of things you can do to improve performance, availability and reachablity of your web site.  I have discussed only a handful of them that I care most about. However, here is a list of checklist items for a new website launch:

Here are 10 checklist items for optimizing a website for performance and SEO:

  • Backend web server optimization - use scalable web server like Nginx and tweak it for high performance and enable compression to minimize file sizes
  • Optimize images by reducing file size, enabling lazy loading, using CDN networks and adding alt text 
  • Minify CSS, JavaScript and HTML content as much possible. 
  • Enable caching data on the backend and browsing caching on the front end
  • Streamline web fonts and eliminate any unnecessary custom fonts
  • Ensure SEO and OpenGraph required meta data are properly set up
  • Audit site with multiple page speed analysis tools

Hope this was a little helpful for you. Let me know in the comments below if you want to go on more in-depth on these things I mentioned here. I can create a YouTube video on this topic if questions demand it.