Embodiments of the present invention provide for compression of files in a filesystem. In embodiments of the present invention, a file is logically partitioned into chunks and each chunk is compressed, such that a request involving a portion of a file can be satisfied by reading and decompressing only the compressed chunk(s) corresponding to that portion.