1. A method for saving a file to a storage system comprising: receiving a file or a portion of a file; compressing the file or portion thereof by: at least partially segmenting the file or portion thereof into segments based on content of the file; determining for each segment, whether the segment is a recurring segment; responsive to determining that a respective segment is a recurring segment, replacing the segment with a corresponding reference; responsive to determining that a respective segment is not a recurring segment, creating a reference for the segment and replacing the segment with the created reference; and saving the file or portion thereof to the storage system.