Skip to content

suside/pub-mirror-nginx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

pub.dev mirror with Nginx

A caching proxy mirror for pub.dev using nginx.

Features

  • Local Package Caching: Implements persistent local storage for Dart packages and API responses using nginx proxy_store directive
  • Format Preservation: Maintains original file integrity by storing packages in their native formats (.json metadata, .tgz archives)
  • Persistent Storage: Cached content survives container restarts and system reboots
  • Intelligent URL Rewriting: Automatically redirects package requests to locally cached versions when available
  • Secure Upstream Communication: Establishes encrypted SSL/TLS connections to the upstream pub.dev registry
  • High Performance: Leverages nginx's proven caching architecture for optimal throughput and low latency

Usage

  1. Start the nginx server:

    docker compose up -d
  2. Configure Dart/Flutter to use the mirror:

    export PUB_HOSTED_URL=http://localhost:8081
  3. Use flutter pub get and/or dart pub get as usual.

Configuration

  • Port: 8081
  • Cache Directory: ./cache
  • Backend: https://pub.dev

Tune docker-compose.yaml to suit your needs.

About

A caching proxy mirror for pub.dev using nginx.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published