• I’m going to start my new website that it covers new posts of some other web resources(by a separate bot). So It’s going to have more & more posts every minute.
    For some different reasons I decided to use wordpress instead of building a new CMS. But the main problem is that wordpress saves posts content in html on database(not compressed)! I need to decrease the growing size of database!

    I wanna know:
    1. How is it possible to compress wp-post main content by a php function like bzcompress?(writing/reading compressed content without any errors)
    2. What are the side effects, updating core problems, … of this operation?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Saving content as compressed is a bit of a false economy. It may help you to keep the database size down (but not that much, seriously, each posts content isn’t going to be that huge before compressing anyway is it??) but you’ll find a lot higher overhead on CPU use from the constant un-compressing that will need to be done on every page load. It also affects searching as you can’t search for text in a compressed record, so you’d never be able to have any sort of site search unless youre using some external indexing service.

    The only reason that I can think of for this is saving database space, and that’s really not a big deal. If the database gets big, then get more hosting space. That’s the best option.

    In the highly unlikely event that you do need compression and it does make sense for the specific scenario, you should be looking for compression provided by the database system itself, i.e. MySQL/MariaDB. E.g. http://dev.mysql.com/doc/refman/5.5/en/innodb-compression.html

    This way, compression will be completely transparent to WordPress (or any other script accessing the compressed table(s)).

    Having said that, that’s a feature you most likely won’t find in any shared hosting plan. For what is worth, I agree @catacaustic above.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Compressing wp-posts in database’ is closed to new replies.