L0ss
← Back to Home

Documentation

Learn how L0ss compresses different file types and what each compression level does.

Compression Levels

L0ss offers three compression levels, each with different tradeoffs between file size reduction and data preservation.

Minimal - Safe Optimizations

Recommended for: Production files where accuracy is critical

Typical reduction: 10-30%

Data loss: Low - Removes only redundant data (whitespace, comments, metadata)

Reversibility: Often 100% recoverable to original structure

Moderate - Balanced Approach

Recommended for: Most use cases - best balance of size and quality

Typical reduction: 30-60%

Data loss: Medium - Removes non-critical data and applies smart optimizations

Reversibility: Partially recoverable (core data intact)

Aggressive - Maximum Compression

Recommended for: Testing, prototypes, or when size is paramount

Typical reduction: 60-90%

Data loss: High - Keeps only essential data

Reversibility: Limited (skeleton structure only)

File Type Compression Methods

JSON Files

JSON compression focuses on removing verbosity while maintaining structure.

Minimal Level:

Moderate Level:

Aggressive Level:

Example:

// Original (428 bytes)
{
  "users": [
    {
      "id": 1,
      "name": "John Doe",
      "email": "john@example.com",
      "bio": "Software engineer with 10 years experience...",
      "score": 87.6543,
      "metadata": {
        "created": "2023-01-15",
        "updated": "2024-01-15"
      }
    }
  ]
}

// Moderate (156 bytes, 64% reduction)
{"users":[{"id":1,"name":"John Doe","email":"john@example.com","score":87.65}]}

CSV Files

CSV compression removes unnecessary columns and rows while preserving data structure.

Minimal Level:

Moderate Level:

Aggressive Level:

JavaScript Files

JavaScript compression focuses on minification and code reduction.

Minimal Level:

Moderate Level:

Aggressive Level:

HTML/CSS Files

Web file compression removes formatting and optional elements.

Minimal Level:

Moderate Level:

Aggressive Level:

SQL Files

SQL compression focuses on query optimization and formatting removal.

Minimal Level:

Moderate Level:

Aggressive Level:

XML/YAML Files

Structured data compression removes verbosity and optional elements.

Minimal Level:

Moderate Level:

Aggressive Level:

Recovery Manifests

Every compression generates a recovery manifest that documents what changes were made. This manifest allows you to understand exactly what was removed or modified.

Manifest Contents:

Using Manifests:

// Download your manifest
GET /api/manifest/:manifestId

// Response includes recovery information
{
  "operations": [
    {"type": "remove_whitespace", "reversible": true},
    {"type": "remove_field", "field": "metadata", "reversible": false},
    {"type": "round_numbers", "precision": 2, "reversible": false}
  ],
  "reversibility": "Partially recoverable"
}

Best Practices

Choosing a Compression Level:

Use Case Recommended Level Reason
Production backups Minimal Preserve all functional data
Development datasets Moderate Good balance for testing
Prototypes/demos Aggressive Size matters more than accuracy
Transfer large logs Moderate Keep essential info, reduce size
Archive old data Minimal Future recovery may be needed

Tips for Maximum Compression:

API Reference

For programmatic access, see the API Endpoints section on the homepage.

← Back to Home