This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Using zipped CSS in html page

Hi,

Using gzipeed JavaScript and CSS files with Keil compact HTTP server.
Does any one knows how to use pre-zipped JS and CSS files in html page.

For example:

I can use and refer zipped JS file.

<script src="jquery.min.js.gz"></script>

but I cannot refer zipped CSS file. browser gives error.

<link href="bootstrap.min.css.gz" rel="stylesheet">

Any reply will be appreciate.

Thanks,
Naeem

Parents
  • It's a negotiation between client and server if the client wants to retrieve compressed files, and what compression to use.

    So you can't specify a file name with any extra ".gz" suffix - the server is expected to compress and send, and the client is expected to decompress before making use of the file.

    When you play with *.gz files, then your server thinks the compressed file is the native format, and the client will get a compressed file with or without any negotiation - and the client will not understand that it is expected to decompress. Some clients just might notice that the file is compressed and decompress it, but they aren't required to handle this.

Reply
  • It's a negotiation between client and server if the client wants to retrieve compressed files, and what compression to use.

    So you can't specify a file name with any extra ".gz" suffix - the server is expected to compress and send, and the client is expected to decompress before making use of the file.

    When you play with *.gz files, then your server thinks the compressed file is the native format, and the client will get a compressed file with or without any negotiation - and the client will not understand that it is expected to decompress. Some clients just might notice that the file is compressed and decompress it, but they aren't required to handle this.

Children