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
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.
Sure, But what is solution for this.
I refer this tutorial to use and refer pre zipped js file.
http://www.keil.com/appnotes/files/apnt_271.pdf
Now how I can use/refer zipped css file in html?
Give me example. Can I can load zipped CSS using JS ajax call and unziped in JavaScript and the load CSS dynamically.