使用gzcompress是个好主意

使用gzcompress是个好主意

问题描述:

I have a forum which allows users to enter large amounts of text along with (sanitized) html (and/or markdown) and links, etc. Everything is sanitised and checked before it is stored in the database.

Would it be a good idea to use gzcompress. I've heard that it is not good if you intend to search this text. Should I compress the content before saving it to the database and use only the title and tags for searching, or does it not matter?

我有一个论坛,允许用户输入大量文本以及(消毒的)html(和/或降价) )和链接等。在将数据存储到数据库之前,所有内容都已经过清理和检查。 p>

使用 gzcompress 。 我听说如果你打算搜索这个文本是不好的。 我应该在将内容保存到数据库之前压缩内容并仅使用标题和标签进行搜索,还是无关紧要? p> div>

I would store the content as text. Then, if space becomes a problem, you can explore an optimization like this later.

You may find this discussion worth reading: Planning for efficiency early vs Premature optimization