https://github.com/kyawthet-naing/web-cache-killer
A Flutter package that solves Flutter web cache problems by automatically renaming JavaScript files with timestamps during build process.
https://github.com/kyawthet-naing/web-cache-killer
flutter flutter-cache flutter-web-cache web-cache-flush
Last synced: about 1 month ago
JSON representation
A Flutter package that solves Flutter web cache problems by automatically renaming JavaScript files with timestamps during build process.
- Host: GitHub
- URL: https://github.com/kyawthet-naing/web-cache-killer
- Owner: kyawthet-naing
- License: mit
- Created: 2025-08-01T01:09:52.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-08-02T05:15:57.000Z (11 months ago)
- Last Synced: 2025-10-23T00:56:29.478Z (8 months ago)
- Topics: flutter, flutter-cache, flutter-web-cache, web-cache-flush
- Language: Dart
- Homepage: https://pub.dev/packages/web_cache_killer
- Size: 22.5 KB
- Stars: 0
- Watchers: 0
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Web Cache Killer
Fixes Flutter web cache problems by automatically renaming JavaScript files with timestamps.
## Why You Need This
When you deploy a Flutter web app, users often see the old version because browsers cache JavaScript files. This tool fixes that by renaming your JS files with timestamps so users always get the latest version.
## Installation
```bash
dart pub global activate web_cache_killer
```
## Quick Start
```bash
# Go to your Flutter project folder
cd my_flutter_project
# Build and create web.zip
web_cache_killer
# Build with custom name (creates beta.zip)
web_cache_killer --name beta
# Build and upload automatically
web_cache_killer --auto-upload
```
## What It Does
**Before:**
```
flutter.js
main.dart.js
```
**After:**
```
flutter_20250801_143022_456.js
main_20250801_143022_456.dart.js
```
All HTML files are automatically updated to use the new names.
## Commands
| Command | What It Does |
|---------|-------------|
| `web_cache_killer` | Build and create `web.zip` |
| `web_cache_killer --name release` | Build and create `release.zip` |
| `web_cache_killer --auto-upload` | Build and upload to tmpfiles.org |
| `web_cache_killer --no-zip` | Build only (no zip file) |
| `web_cache_killer --verbose` | Show detailed output |
| `web_cache_killer --no-clean` | Skip flutter clean (faster) |
## Output Example
```
๐ Web Cache Killer
==================================
Checking requirements...
โ
Requirements satisfied
๐งน Cleaning...
โ
Cleaned
๐ฆ Getting dependencies...
โ
Dependencies ready
๐ง Building web...
โ
Build completed
๐ Applying cache busting...
โ
Cache busting applied (3 files)
๐ฆ Creating deployment package...
โ
Successfully created web.zip (Size: 7.9M)
==================================
๐ Build Completed!
โ
Created: web.zip
๐ Build: /path/to/project/build/web
```
## File Structure
**Default build:**
```
build/
โโโ web/ # Your app files
โโโ web.zip # Ready to deploy
```
**Custom name build:**
```
build/
โโโ release/ # Your app files
โโโ release.zip # Ready to deploy
```
## Upload Feature
Upload your zip automatically to get a direct download link:
```bash
web_cache_killer --auto-upload
```
You'll get a link like: `http://tmpfiles.org/dl/123456/web.zip`
## Common Issues
**โ "pubspec.yaml not found"**
- Make sure you're in your Flutter project folder
**โ "Flutter not found"**
- Install Flutter: https://flutter.dev/docs/get-started/install
- Make sure `flutter` command works in your terminal
**โ Upload fails**
- Check your internet connection
- Your zip file is still saved locally in the `build/` folder
## Requirements
- Flutter SDK installed
- Dart 2.12+
- Run from Flutter project root (where `pubspec.yaml` is)
## Features
โ
**Cross-platform** - Windows, macOS, Linux
โ
**Zero setup** - Just install and run
โ
**Cache busting** - Automatic timestamp renaming
โ
**Custom names** - Name your builds
โ
**Auto upload** - Get instant download links
โ
**Fast builds** - Skip clean with `--no-clean`