SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,656
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)

    mod_deflate: Best way to compress? Via Cpanel vs .htaccess vs php snippet?

    mod_deflate: Best way to compress? Via Cpanel vs .htaccess vs php snippet? Im trying to speed up my site. compression is one of the ways i intend to do it. Those are all the ways I've found. What are the plus and minuses of each? Do you prefer one way over the other and why? Thanks!

    Ps. Hostgator only uses mod_deflate as far as I know. O is that just in the Cpanel way. Maybe I could gzip or other using one of the other methods??

  2. #2
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,656
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Ok I been reading. I'm going with the htaccess one. Just need to fine tune that code. There are 10 different versions on the web.

  3. #3
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,656
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    Ok here is the best I could find. Hello anyone know better? http://www.askapache.com/htaccess/ap...mpression.html

  4. #4
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,603
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    I typically look at the htaccess file fould in the HTML5 boiler plate for ideas and techniques, since they're vetted by a group of web developers:

    http://html5boilerplate.com/

    You'll find their htaccess file compression solution in there (which I use on the websites I develop).
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  5. #5
    SitePoint Enthusiast
    Join Date
    Nov 2012
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Force Flow View Post
    I typically look at the htaccess file fould in the HTML5 boiler plate for ideas and techniques, since they're vetted by a group of web developers:

    http://html5boilerplate.com/

    You'll find their htaccess file compression solution in there (which I use on the websites I develop).
    the html5 boilerplate is great if you know what to loo for, but sometimes there are things that you will never use, so i use it like you do, to get ideas

  6. #6
    SitePoint Wizard bronze trophy PicnicTutorials's Avatar
    Join Date
    Dec 2007
    Location
    Carlsbad, California, United States
    Posts
    3,656
    Mentioned
    15 Post(s)
    Tagged
    0 Thread(s)
    OK here is what I ended up with. After reading for weeks on this I think this is the best setup. The only thing it seems I went out on a limb on is caching html for a long time. I toyed with this in my brain. Many say cache css for a long time. Well I can't cache css, or js for that matter, without caching the html. When ever I edit one 9 times out of 10 I'm editing one of the others. Well if one is a new copy and one isn't the user will very likely see something wonky or unstyled, or un-js'ed.

    My question is this? Am I missing something about caching the html? Or is the only downside the user waits 90 days to see the updated copy? Additionally Google always sees the newset copy correct? Thanks for your knowledge!

    # Compress Files
    <FilesMatch "\.(js|css|html|php|xml)$">
    SetOutputFilter DEFLATE
    </FilesMatch>

    # Turn off the ETags
    Header unset ETag
    FileETag None

    # Cache Files 90 Days
    <filesMatch "\.(html|css|js|swf|pdf|xml|mp3|gif|jpg|png)$">
    ExpiresActive On
    ExpiresDefault "access plus 90 days"
    Header append Cache-Control "public"
    </filesMatch>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •