Compress data when saving to local storage