-1

htaccess is a special configuration file in which you should be able to dig up in the root of your server directory.

How can I speed-up my Website using htaccess

My Website Score:

  • Desktop : 61

  • Mobile : 42

How can I improve my website page speed?

James Z
  • 12,209
  • 10
  • 24
  • 44
  • I dont see how .htaccess could speed up a site. Ways to speed up a site are many and you can search for different threads online for some advice. I'd suggest you delete your post asap before the morning crew sees this and see your rep steadily decreasing. – GetSet Feb 26 '20 at 07:19
  • OP could you provide further details on why your site is loading slow. U make tag mention to "opencart". Do you have a lot of images? If you are then you could optimize them to be "browser ready". Hi def wouldn't be necessary on say a thumbnail preview for example. – GetSet Feb 26 '20 at 07:25

1 Answers1

0

I have completely tested it on my website.

You can add the following code in your .htaccess file in the route Directory.

# Compress Text, HTML, JavaScript, CSS, and XML
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Remove Browser Bugs
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
Header append Vary User-Agent
halfer
  • 19,824
  • 17
  • 99
  • 186
Mujahid Bhoraniya
  • 1,518
  • 10
  • 22
  • I will try this out myself actually – GetSet Feb 26 '20 at 07:23
  • 1
    @GetSet. 100% working dear. you can try after give me thankful or upvote my answer. – Mujahid Bhoraniya Feb 26 '20 at 07:25
  • OP mentions "opencart". Possibly he/she is using un-optimized images. I asked OP a moment ago after seeing where your optimizations were in your answer. – GetSet Feb 26 '20 at 07:26
  • @MujahidBhoraniya. i will try after reply ASAP. –  Feb 26 '20 at 07:28
  • I didnt downvote by the way. I rarely do. And I havent checked your optimizations yet. But I learned from you @MujahidBhoraniya that here is when the "gzip" business comes in. So im upvoting. OP has yet to answer about those hi-res images he/she is displaying for such poor load page performance however. – GetSet Feb 26 '20 at 07:38
  • @MujahidBhoraniya. nice answer uploading. very very satisfied. Now my score is D:88 and M:72. great working right now –  Feb 26 '20 at 08:04
  • Was a good answer I too can use this "gzip" business. A question at OP, are you images optimized? – GetSet Feb 26 '20 at 09:16
  • @GetSet. upvote my answer if you are satisfied. – Mujahid Bhoraniya Feb 26 '20 at 09:17
  • @MujahidBhoraniya I like the "gzip" business. I am completely unsatisfied on "scores" from OP's answer. Have OP clear browser cache. And test results from that without "scores". I asked OP a direct question on image optimization, no answer. I doubt if you are even satisfied by this. Again many ways to make pages load faster and be more "ready". If his/her images are in cache, the "score" is *tilted*. – GetSet Feb 26 '20 at 09:23