• First, I’d like to thank the plugin author for a brilliant plugin. Absoluuutely brilliant and it does more for me than I have any right to expect.

    I’m just having a minor issue with my self hosted CDN setup. The .css and .js files are being served from the CDN, but they’re not being compressed. But if I disable the CDN altogether, then the files are being sent in compressed format from the regular host – no problem.

    I’ve enabled compression in the w3 cache options for all file types.
    I’m on a Godaddy shared hosting plan and server side mod_deflate/gzip isn’t enabled for me.

    Is this by design?

Viewing 14 replies - 1 through 14 (of 14 total)
  • Plugin Contributor Frederick Townes

    (@fredericktownes)

    Can you check and make sure that there is an .htaccess file on your subdomain? Can you paste it here or submit a bug submission form from the support tab of the plugin?

    Thread Starter bhagwad

    (@bhagwad)

    I checked and there isn’t a .htaccess file on the subdomain! The subdomain is just a folder on the main domain, so I didn’t know I would need one. Clearly I seem to be wrong.

    Which .htaccess file shall I put into it to make it work like it should?

    Thread Starter bhagwad

    (@bhagwad)

    I just saw your comment on another forum to use the wp-content/plugins/w3-total-cache/ini/_htaccess file in the subdomain, but there isn’t any such file.

    I guess the updated version doesn’t have it?

    Thread Starter bhagwad

    (@bhagwad)

    I added this .htaccess file from the “Install” section of the plugin to the subdomain folder – it still didn’t send it compressed:

    # BEGIN W3TC Minify
    <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresByType text/css M3600
        ExpiresByType application/x-javascript M3600
    </IfModule>
    <IfModule mod_mime.c>
        AddEncoding gzip .gzip
        <Files *.css.gzip>
            ForceType text/css
        </Files>
        <Files *.js.gzip>
            ForceType application/x-javascript
        </Files>
    </IfModule>
    <IfModule mod_deflate.c>
        <IfModule mod_setenvif.c>
            SetEnvIfNoCase Request_URI \.gzip$ no-gzip
        </IfModule>
    </IfModule>
    <IfModule mod_headers.c>
        Header set X-Powered-By "W3 Total Cache/0.9.1.1"
        Header set Vary "Accept-Encoding"
        Header set Pragma "public"
        Header set Cache-Control "public, must-revalidate, proxy-revalidate"
    </IfModule>
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /blog/wp-content/w3tc/min/
        RewriteCond %{HTTP:Accept-Encoding} gzip
        RewriteRule .* - [E=APPEND_EXT:.gzip]
        RewriteCond %{REQUEST_FILENAME}%{ENV:APPEND_EXT} -f
        RewriteRule (.*) $1%{ENV:APPEND_EXT} [L]
        RewriteRule ^([a-f0-9]+)\/(.+)\.(include(\-(footer|body))?(-nb)?)\.[0-9]+\.(css|js)$ index.php?tt=$1&gg=$2&g=$3&t=$7 [L]
    </IfModule>
    # END W3TC Minify

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    I’m not clear on how you’re using the self-hosted CDN. It’s not going to work properly if you’re using a directory on the same domain as your web site. Compression also won’t work if your server is missing mod_deflate module for apache.

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    Well if your server is missing the modules, then it cannot be done. Also there is no benefit to use the same domain, I really do not recommend it, you’ve defeated the purpose of the feature completely.

    Thread Starter bhagwad

    (@bhagwad)

    Thanks for the reply Frederick.

    But in the W3 help section, you’ve recommended just this! From the FAQs

    “Create static.domain.com on your server (and update your DNS zone) and then specify the FTP details for it”

    Isn’t this what you meant?

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    My directions recommend subdomain.domain.com not domain.com/cdn/ for domain name.

    Thread Starter bhagwad

    (@bhagwad)

    I think we misunderstood each other.

    That’s what I’m doing. I’ve created a subdomain w3css.bhagwad.com. The files for w3css.bhagwad.com are in a folder on the same shared server.

    Isn’t that what you meant?

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    The document root should be used, subdirectories are not officially supported.

    Thread Starter bhagwad

    (@bhagwad)

    Thanks Frederick

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    You’re welcome.

    I think I understand the confusion.
    I’ve just created a subdomain which my host tells me is mysubdomain.mysite.com, but for uploading files it appears as a folder with the name mysubdomain in my root directory.

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    @nick_nielsen, so you’re all set then? As that scheme is fine.

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: W3 Total Cache] Compression on self hosted CDN?’ is closed to new replies.