How to Fix Leverage browser caching ?
Leverage browser caching for the following cacheable resources:
How to Create .htaccess file.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
The above code is created by creating a file of .htaccess, put it in it and save it, your Leverage browser caching problem will be solved.
How to Fix Properly size images ?
Serve images that are appropriately-sized to save cellular data and improve load time.
When you open the website and go to Inspect and click on the URL containing the image, then your image should be of the same size as you see in the Rendered size, the Width and Height that you see in the Intrinsic size. The size of the size in which you have uploaded, now you are getting to see the Height and widht in the Rendered size, resize it and then upload / replace it.
How to Fix Serve static assets with an efficient cache policy ?
A long cache lifetime can speed up repeat visits to your page.
How to Create .htaccess file.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType application/javascript "access 1 month"
ExpiresByType application/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 2 days"
</IfModule>
The above code is created by creating a file of .htaccess, put it in it and save it, your Leverage browser caching problem will be solved.
http to https redirect htaccess
To force any HTTP request to redirect to HTTPS, you can add code to your WordPress .htaccess file.
How to Create .htaccess file.
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
http://example.com to https://example.com redirect auto without any plugins
The above code is created by creating a file of .htaccess, put it in it and save it, your Leverage browser caching problem will be solved.
How to Enable GZIP Compression to Speed Up Your Site
this script compress your all website script use for increase loading speed.
Gzip compression on a website can be enabled using two methods – installing a WordPress plugin or editing the .htaccess file.
How to Create .htaccess file.
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_include mime ^text/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_include handler ^cgi-script$
</ifModule>
GZIP is a compression technology frequently used for transferring data quickly over the internet. “GZIP” refers to a compression method, software used to compress files with this method, and the file format that results from GZIP compression (usually indicated by the file extension . gzip).
The above code is created by creating a file of .htaccess, put it in it and save it, your Leverage browser caching problem will be solved.