开发者

Replace string in gzip file

I plan to gzip and cache html pages in the database. Few parts of开发者_如何学JAVA the cached page need to be replaced with fresh data when it is served back to user.

Is there away to replace string directly in the gzipped pages without ungzipping them? I am using php


Is there away to replace string directly in the gzipped pages without ungzipping them?

Simple question, simple answer: No it's not.

It's because to modify the original data you need to un-gzip the compressed data first, then modify the uncompressed data and then gzip the whole data again. Gzip always compresses a whole chunk of data, so unless you don't change the whole chunk, you need to uncompress, change and recompress.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜