Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    39
    Thanks
    7
    Thanked 0 Times in 0 Posts

    How do you gzip html files?

    I downloaded the windows gzip exe from here:

    http://www.gnu.org/software/gzip/


    Whenever I try to run:
    "gzip index.html" in the cmd shell, I receive a "No such file or directory error".
    Javascript files compress fine.


    HOWEVER how can I use the compressed javascript files? They don't seem to load properly, despite the fact i've changed the appropriate script src extensions (appended .gz) and of course uploaded the .gz javascript files

    Am I using the wrong gzip?

  • #2
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    As for how to use the gzip program, check out the command line parameters as detailed in the gzip manual. You can also use GUI tool like 7-Zip to do your gzipping if you prefer that method.

    As for how to serve gzipped content, that depends on what server you have and what settings it's running on, and whether the files you are serving are static or dynamic. (Dynamic files obviously need on-request gzipping, while static files can be gzipped once and choose to serve the gzipped version or the original version depending on the Accept-* headers sent by the client.)
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

  • #3
    New Coder
    Join Date
    Jul 2006
    Posts
    39
    Thanks
    7
    Thanked 0 Times in 0 Posts
    hi thanks for the reply

    all of my files are static, so i want to gzip them before hand and not have to gzip on the fly.

    I'm on an apache 1.3 server. What settings must I use? Will safari2-3/opera8+/ie6-7/firefox2 interpret the .gz files correctly?

  • #4
    Master Coder
    Join Date
    Feb 2003
    Location
    UmeŚ, Sweden
    Posts
    5,575
    Thanks
    0
    Thanked 83 Times in 74 Posts
    You probably want to check out the Apache 1.3 documentation on content negotiation.
    liorean <[lio@wg]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards


  •  

    Posting Permissions

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