Advance

How to reduce load and increase site speed

How to reduce load and increase site speed
1
(1)

How to reduce load and increase site speed. In a growing environment, it is important that the server plays its role properly. However, there are peak times when your server crashes or you exceed the virtual bandwidth allocated to you.

A server may crash for a variety of reasons. There are several possibilities for the cause of each accident. This can be confusing for a small group of developers.

One of the things we have encountered in managing websites is that in many cases these websites are not the fastest sites in the world. Although the reason for the slowness of many sites is due to the configuration of the host server, there are still some problems in the performance of the website that you can control.

In this article, we provide you with the best solutions to reduce server load and save bandwidth for growing websites.

Eldernode provides secure and fast web hosting, premium performance features.

In the continuation of this article, 11 tricks to reduce server load and save bandwidth will be taught. Stay with us.

Recommended Article: How To Install MongoDB 4 In CentOS 8

How to reduce load and increase site speed

 

1. Use CSS code instead of images

 

How to reduce load and increase site speed

 

Using images will slow down your website and increase the bandwidth consumed. Instead of using an image in the background of your website, use CSS code.

For example, if you want to use plain red for the background, you should use the following CSS code instead of red-bg.jpg:

background-color: # F00

With CSS, you can adjust the color or background image of any CSS section.

 

2. Optimize your images

 

How to reduce load and increase site speed

 

More than half the bandwidth of most websites is consumed by images, and optimizing these images is the best way to improve the web server consumed bandwidth.

Optimize website images to fit the internet space and make them as small as possible.

Note: Never use (.bmp) files, they are very large!

The best file format for the images you use on your website is jpeg (.jpg) or gif (.gif). These formats are optimized for the Internet.

It is a good rule of thumb to try not to make any images larger than 10 KB. It is difficult to follow this rule when dealing with moving images and animations. But if you can do it, you will see a significant difference in the bandwidth used by the server.

There are various programs and applications for converting images to various formats on the Internet.

How to reduce load and increase site speed-Eldernode.com

Note: There are a variety of optimization programs for images. Make sure you use software that maintains its quality despite the reduced image size!

If you use Photoshop, you can compress your images with the “Save to Web and Devices” option (Alt + Shift + Ctrl + S) to optimize it and use the minimum bandwidth.

If you have an image with a large number of colors, you should choose the JPEG or PNG format.

 

3. Shorten your CSS code

 

How to reduce load and increase site speed

 

CSS files can be very large due to the large amount of extra space. The CSS summary feature is excellent. Using this feature is a great way to reduce the amount of code in a CSS file and allows you to download many times faster and edit easier.

For example, use the following code:

margin: 2px 1px 3px 4px (top, right, bottom, left)

Instead of code…

1 margin-top: 2px;  2 margin-right: 1px;  3 margin-bottom: 3px;  4 margin-left: 4px

 

4. Remove code, unnecessary HTML tags and white spaces

 

How to reduce load and increase site speed

 

You can compress your page size by removing white spaces within HTML files, even deleting comments (if not needed). Because every extra character in the file means increasing its size.

Whether you use HTML image editors or Notepad, your HTML file will include extras such as unnecessary spaces, returns, meta tags, default values ​​in HTML elements, and more. These things make your web pages bigger without achieving any specific purpose.

Larger web pages take longer to load, increase data traffic to your web server, and waste valuable bandwidth.

 

5. Use AJAX or JavaScript libraries

 

How to reduce load and increase site speed

 

AJAX is a web page technology for connecting to a server using JavaScript without having to reload the page.

In general, relevant pages on a website consist of a large portion of the content. Using traditional methods, all this content is loaded in each request. But if AJAX is used, a web application will only request the part of the content that it needs to update. Therefore, it is very effective in reducing the bandwidth consumption of loading time.

How to reduce load and increase site speed-Eldernode.com

 

6. Disable Hotlink files

 

How to reduce load and increase site speed

 

The term Hot link means linking images or downloads from your website to other websites.

Basically, the images are on your website and other websites only link image tags to your website, so they use your bandwidth.

Note: If others so-called hot link your video files, they are using bandwidth, which you will eventually pay for.

You can easily prevent this by putting a ‘.htaccess’ file in the images folder.

By doing this, only the pages of your website will be allowed to display images, and another link outside of your website or the websites to which you have licensed, will be shown with a red cross instead of the image.

1 RewriteEngine On  2 RewriteCond %{HTTP_REFERER} !^$    3 RewriteCond %{HTTP_REFERER} !^http(s)?://(.*\.)?yourserver.com [NC]  4 RewriteRule \.(jpeg|jpg|gif|png)$ - [F]

 

7. Compress your HTML and PHP files with GZIP

 

How to reduce load and increase site speed

 

Similar to CSS files, HTML files contain a lot of white space and unused sections.

If you are using PHP, you can use the mod_gzip module to ask the Apache web server to compress your content.

mod_gzip is a module for Apache (available on both Linux and Windows versions of Apache), which can significantly reduce the size of a webpage in any request from a browser that can understand compressed content.

Remember, the good thing about this module is that the compression feature on the server is only enabled when a request for compressed content is sent from the browser. If the browser does not send such a request or fails to understand the compressed content, the server will also deliver the uncompressed content.

The easiest way is to use the .htaccess file.

We recommend using this file because it is more simple to run.

The .htaccess method allows you to configure the server later.

Now add the following line to .htaccess to enable GZIP compression:

php_value output_handler ob_gzhandler

If you can add a sequence for the PHP compression function, you should insert the following line in the header of your web pages at the top of the page:

< ? ob_start("ob_gzhandler");?>

 

8. Use free web and image hosting websites to embed your website files

 

How to reduce load and increase site speed

 

If you want to share large files without consuming your bandwidth, host them on free or paid hosts like Flickr, Pikasa, PhotoBucket, ImageShack and rapidshare.

After uploading the files, put the link to them on your blog or website.

This saves a considerable amount of your bandwidth.

Tip: Before doing this, talk to your web host company about whether they will allow you to do so.

 

9. Avoid attachments as much as possible

 

How to reduce load and increase site speed

 

If you are planning to upload a file to your server that has already been placed elsewhere on the Internet, it may be best to use a link to the same file instead of placing a copy of it on your server.

Uploading a file increases both bandwidth consumption and server load. But you can save time by using the file link that is already available on the Internet because you no longer need to upload files.

 

10. Website cache

 

How to reduce load and increase site speed

 

Caching is a method of recovering data from ready-made memory (cache).

Instead of recreating the same required information each time using server resources, they are read from cache.

Another good idea is to cache your website but set an expiration date in the HTTP headers.

So the times set in the header tell browsers how long to keep the content in the cache.

Most website images will never change and it is a good idea to keep them cached locally.

 

Caching with mod_headers

1 # 1 YEAR  2 <filesmatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$"="">    3 Header set Cache-Control "max-age=29030400, public"  4 </filesmatch>    5  6 # 1 WEEK    7 <filesmatch "\.(jpg|jpeg|png|gif|swf)$"="">  8 Header set Cache-Control "max-age=604800, public"    9 </filesmatch>  10    11 # 3 HOUR  12 <filesmatch "\.(txt|xml|js|css)$"="">    13 Header set Cache-Control "max-age=10800"  14 </filesmatch>    15  16 # NEVER CACHE    17 <filesmatch "\.(html|htm|php|cgi|pl)$"="">  18 Header set Cache-Control "max-age=0, private, no-store, no-cache, must-revalidate"    19 </filesmatch>

 

Cache with mod_expires

1 ExpiresActive On  2 ExpiresDefault A0    3  4 # 1 YEAR    5 <filesmatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav)$"="">  6 ExpiresDefault A9030400    7 </filesmatch>  8    9 # 1 WEEK  10 <filesmatch "\.(jpg|jpeg|png|gif|swf)$"="">    11 ExpiresDefault A604800  12 </filesmatch>    13  14 # 3 HOUR    15 <filesmatch "\.(txt|xml|js|css)$"="">  16 ExpiresDefault A10800"    17 </filesmatch>

 

11. Caching RSS Feeds

 

How to reduce load and increase site speed

 

RSS, as it is commonly known, is a technology that enables webmasters to easily distribute and publish content on the Internet.

When the feed is cached, it is read from the local disk for a certain period of time. The RSS Feed will be reloaded after that time expires. This allows the RSS Feed content to remain in display and speed up the whole process.

Caching RSS feeds reduces bandwidth consumption because the web server does not have to download the same RSS feed from its server.

Recommended Article: How to reduce load and increase site speed

Dear user, we hope you would enjoy this tutorial, you can ask questions about this training in the comments section, or to solve other problems in the field of Eldernode training, refer to the Ask page section and raise your problem in it as soon as possible. Make time for other users and experts to answer your questions.

How to reduce load and increase site speed-Eldernode.com

How useful was this post?

Click on a star to rate it!

Average rating 1 / 5. Vote count: 1

No votes so far! Be the first to rate this post.

We Are Waiting for your valuable comments and you can be sure that it will be answered in the shortest possible time.

Leave a Reply

Your email address will not be published. Required fields are marked *

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day