开发者

how to use gzip in classic ASP

I would like to use GZIP开发者_StackOverflow社区 compression in classic ASP.I don't know the code for the same.Please help me what line of code should i put to use GZIP compression in classic ASP for my website.

I also want to compress CSS and javascript.Suggest howto do that.

Your help in this regard will be highly appreciated.

regards, sunny


Are you talking about the data-stream you send back to the client? If so, this is normally the business of IIS and not something you'd control in ASP (and I don't think you have any control of it over ASP anyway). This can be done at the command line as:

cscript.exe adsutil.vbs set W3svc/Filters/Compression/GZIP/HcScriptFileExtensions "asp"
cscript.exe adsutil.vbs set W3svc/Filters/Compression/GZIP/HcFileExtensions "css" "js" "html"

You may then need to restart IIS for the changes to take effect, so from command line:

iisreset

This MSDN article goes into all the details further.

If you're wanting to gzip and gunzip files that you subsequently work with in ASP, then you'll need an appropriate gzip library. There's a few articles out on t'interwebs for this suggesting libraries, techniques, etc.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜