Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
in Q2A Core by
edited by
can anyone share .htaccess code to enable gzip? I am using donut theme
Q2A version: 1.7
What do you mean? Gzip code for doing what?
I mean .htaccess coding to enable gzip & compress data because bootstrap has so many unused classes & lines

2 Answers

+2 votes
Best answer

I am Answering Myself..

I found this code. Place this code in your .htaccess & it will speed up your site little bit. I hope this will help someone, Thank You.

<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript

0 votes
edited by
<IfModule mod_expires.c>
    ExpiresActive On
    # ExpiresDefault     "access plus 2 days"
    ExpiresByType text/css     "access plus 1 month"
    ExpiresByType text/javascript             "access plus 1 month"
    ExpiresByType application/javascript     "access plus 1 month"
    ExpiresByType application/x-javascript     "access plus 1 month"
    ExpiresByType image/ico         "access plus 1 month"
    ExpiresByType image/x-icon         "access plus 1 month"
    ExpiresByType image/gif         "access plus 1 month"
    ExpiresByType image/jpg         "access plus 1 month"
    ExpiresByType image/jpeg         "access plus 1 month"
    ExpiresByType image/png         "access plus 1 month"
    ExpiresByType image/svg+xml     "access plus 1 month"
    ExpiresByType application/x-shockwave-flash     "access plus 1 month"
    ExpiresByType video/mp4         "access plus 1 month"
    ExpiresByType video/ogg         "access plus 1 month"
    ExpiresByType video/webm         "access plus 1 month"

# GZIP for js, css and html
<IfModule mod_deflate.c>
  <FilesMatch "\.(js|css|html)$">
    SetOutputFilter DEFLATE
why you are using caching PNG twice (    ExpiresByType image/png         "access plus 1 month" )?
And also on my site users are not allowed to upload any video just youtube videos are shown & I think those are just thumbnails and just shockwave/flash so can I remove  these 3 lines
    ExpiresByType video/mp4         "access plus 1 month"
    ExpiresByType video/ogg         "access plus 1 month"
    ExpiresByType video/webm         "access plus 1 month"
Thanks good catch. And yes, you can delete any type you like / don't need.