How to enable compression on 000webhost.com?

I’m having issues with my site, and I was wondering if you guys could help me out. I want to enable compression on my site, but I don’t know what to do. I am not a advanced user of coding or website design. I’m just a student but I would like to add things like this to my arsenal of trick to better others sites as well. Please explain the procedure in detail? Step by step, and where to place the needed file for the issue to be a win. Thanks.

https://varvy.com/pagespeed/enable-compression.html

Adding the code in the first section to your .htaccess should help a bit, but because there is a 1000mb storage limit this may not help much. We don’t have an option to compress the site otherwise, but if you need more storage space I suggest upgrading to premium.

That is the thing where is the .htaccess file? I don’t see it no were on the filemanager. Can I make it and add it in there, and then where? I mean in my Hosting I only have the folders “home”, and “public_html” and a “ftpquota” file in it.

I have made a .htaccess file, and placed it in the main part of the Hosting server. Where I can see the mentioned folders. Just that it’s not compressing the site.

You need to make the .htaccess file in public_html and then paste the following code inside it.

<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 handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>

Let me stress that this may not make any difference at all.

1 Like

I did this, but this code didn’t work. In other post I have heard that you have to place it where their is root access. My File Manager doesn’t show me hidden files, and I don’t see anything in Filezilla saying that it is this file. I made it, and added the code that you suggested but it’s not working.

Here is my site.[Nerd Alert Computer Consulting](http:// www.nerdalertcomputerconsulting.com)

I used Mobirise to make my site, and I am really just starting out. Could you possibly check it out, and let me know what I can do to compress the site? Do I need to like I don’t know make all the folders for my assets zip files or whatever I need to do? I want my site to be able to pass the Google Site checker.

That’s odd. There may not be a way to compress anything on free hosting. You should remove the .htaccess file I guess. What I again suggest is upgrading, where performance is faster. You shouldn’t need to compress anything to pass Google Site Checker.

Yet there is where the challenge is my boy. To make it to where regardless of the fact of the free or paid I should be able to compress my site right? I mean it isn’t something that is to far fetch to where I would have to dish out a fee for a addition to code wouldn’t you think? Cause since it is free then really all I would have to do is find a service that provides compression for free? I mean their are other options, but I like this place, and I just want to see what my options are before I really choose to invest with 000webhost due to the fact that they have been hacked. I would suggest more people to them, but this is my real first site that I had to make from scratch. So that is why I would like to add the compression to this one to make sure that I can suggest this service for others. You see?

But the issue is that we don’t offer compression, and we don’t plan to.

Maybe try compressing your html files using this webpage, but that may not work either.

Like turn all of them into zips files right? Like each one individually?

That would result in your site being hard to view. Let me talk to admins and see if they can suggest a method.

000webhost enables GZIP compression by default on text/html content.

I have tried several GZIP combinations provided by @sulliops, but with no luck. I think the configuration comes directly from 000webhost and it does not allow overriding. And I think that’s the way it should, because gzipping every content from website harms the servers a lot.

I took a look at your website. Most of the content comes from external sources. GZIP will only work for the content loaded from your website.


News: your text/* content seems to be gzipped! I think @sulliops’s code worked. :slight_smile:

Perhaps it may take some time for changes to propagate, after you update the .htaccess file.

1 Like

@theguyjosef Can you try again as @sulliops suggested.
Because it worked fine for @Captainjjjacksparrow.