Search Engine Optimization for ASP.NET Core Simply
We developers code web apps everyday. But how many of us developers think about getting some love from our search engines. If you want your app to be found and be a hit you must definitely think about few factors right from the first day of your developing app.
Today I’m going to give you few tips on getting more traffic to the web app you develop. Mainly targeting ASP.NET audience but these tips are universal. :)
1) Enable Compression
Did you know you can compress the content that is sent to your user? Well you can and improve the speed of your site hugely. You can utilize the processing power of the devices that’s just sitting there on the both ends to improve the speed.
Here you can learn how you enable compression for your sites. Response Compression Middleware for ASP.NET Core
What You Shouldn’t Do
You shouldn’t enable compression for your images and the files that are smaller than 150–1000 bytes. Just compress CSS, JavaScript, HTML, XML, and JSONs.
2) Minify JavaScript & CSS
One of the main old idea when it comes to SEO is that you shouldn’t worry about your CSS & JavaScript files because SEO bots are only looking at your HTML files. Well that’s wrong. In 2017 Google usually renders your page just like the browser (and it’s not new). So, the content loading speed matters.
Well that’s why you should create a minification and obfuscation workflow for your web app. Gulp the NPM package does it all for you.
Here you can learn how to enable gulp for your ASP.NET core project: How to Use Gulp with ASP.NET Core MVC
3) Leverage browser caching
Browser caching is remembering the resources the browser has already loaded. When a visitor goes to another page on your website the already loaded resources won’t be requested from the server. Such as Scripts, CSS files and Logos/Images.
Here you can learn more and learn how to get started implementing Cache-Control
today: Response caching in ASP.NET Core
4) Prioritize visible content
Visible content is the portion of a webpage users see on their screen before they scroll. You should consider showing the content faster that is displayed initially so that your users will get the premium feeling that your site very fast.
Here’s a article that will give some tips on achieving this. Prioritizing Visible Content
5) Eliminate render-blocking JavaScript and CSS
The time that your site takes to finish loading tells a lot about your site to the user. Adding script files to the rendering path blocks the rendering of your pages until the scripts are executed. this gives the user a non-premium feeling of your site.
Did you know about differ
and async
keywords that was introduced for HTML for getting rid of this? Here's a great resource for you to know the meaning of the two words and how to use them appropriately. Async & Differ Attributes
6) Make your site crawlable
Google is never going to find pages in your site if you don’t have internal links to all of the pages. For example if you want google to index your products.php page, you should develop your site in a way that google can traverse to products.php from the homepage.
Also never keep dead links in your site this will hint google that your site is not a well-maintained one. You can goto Google Search Console to see how your site is performing in areas like dead links, server response times, errors and much more.
7) Making the URLs meaningful
Have you seen some sites have URLs like this?
https://www.example.com/product?biw=1366&bih=637&tbm=isch&sa=1&ei=fVUQWq6H
Also when you go to some popular sites have seen URL structures like this?
https://www.example2.com/iphone-7-plus-with-a-cool-cover
Which site do you think is going to have a higher SEO score? Obviosly the second one.
Because the search engine gives a lot of importance to the URL text of your site also how close your main keywords are to the domain of the site. So consider making more meaningful urls. this is one task that we should think about from the start.
Hope you learned something new today! :D