Media files
Compression
Using compressed media files on websites is desirable for two reasons:
- Lower storage requirements server side
- More responsive upload rates/less time taken to transfer files to client side
Compression techniques are categorised as lossy or lossless.
Lossy compression
File formats that support lossy compression will remove some of the original data when compressing a media file.
Lossless compression
Lossless compression maintains all the original data but usually leads to lower compression ratios compared to lossy compression.
This means that lossless files are usually larger in size than lossy files.
While compression is generally good, there can be a trade-off between compression rates and quality. Web developers will try to utilise compressed file formats that maintain a quality level acceptable to end users.