Flutter Auto Cache 提供自動快取管理,內建加密、智慧取代與無效化策略,以及高效能的大小處理。它透過自動管理資料生命週期來簡化永久儲存,並透過加密確保安全性,同時在各平台間優化空間使用。非常適合需要可靠、安全且低維護成本的使用者或應用程式資料快取之應用程式。此套件支援所有主要的 Flutter 平台,並透過直覺的 API 實現無縫整合。
適用情境
快取 API 回應
安全儲存使用者偏好
在會話之間持續應用狀態
高效管理大型數據集
透過快取資料減少網路請求
保護敏感的本機資料
主要特色
快取資料的自動加密
可設定的驅逐和無效策略
高效記憶體和磁碟空間管理
跨平台相容性
與現有程式碼的簡單整合
對複雜資料類型的支援
適合對象
需要安全本地儲存的應用程式
尋求自動化快取處理的開發者
具有頻繁數據持久化需求的項目
面向多個平台的應用程式
重視數據安全的團隊
低維護快取解決方案
使用建議
需要仔細配置策略以獲得最佳效能
可能增加初始設定的複雜性
加密會帶來微小的開銷
不適用於即時串流資料
僅限鍵值儲存模型
取決於底層檔案系統的可靠性
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
Introduction
Flutter Auto Cache is a sophisticated, high-tech cache manager for Flutter, designed to optimize cache management in mobile applications. Enhances cache replacement policies, provides robust encryption methods, and ensures efficient disk space management. Leveraging shared_preferences, our platform delivers a comprehensive solution for cache data management.
With Flutter Auto Cache, you can seamlessly integrate advanced cache management features, allowing you to focus on your application’s core functionality while we handle the complexities of data caching. Our user-friendly interface and powerful capabilities make Flutter Auto Cache the go-to choice for Flutter developers aiming to achieve high performance and security in their applications.
Experience unparalleled efficiency and reliability in cache management with Flutter Auto Cache.
Installation
Getting started with Flutter Auto Cache is straightforward and can be accomplished in a few simple steps. You have the flexibility to add it to your project directly from pub.dev or install it locally, depending on your development preferences and workflow.
Adding via pub.dev
To add Flutter Auto Cache to your project, run the following command:
flutter pub add flutter_auto_cache
Installing Locally
If you prefer to install Flutter Auto Cache locally, follow these steps:
Once installed, you can start using Flutter Auto Cache in your Flutter project to enhance your application's cache management with advanced features, including encryption and efficient disk space management.
Usage
To use Flutter Auto Cache, you need to initialize the cache manager before calling runApp. This ensures that all cache configurations are set up correctly. You also have the option to pass your custom initialization configuration.
import'package:flutter_auto_cache/flutter_auto_cache.dart';
Future<void> main() async {
/// Optional: Pass a custom CacheConfiguration if neededawaitAutoCacheInitializer.initialize(configuration: yourCustomConfiguration);
runApp(MyApp());
}
After initialization, you can use the cache management methods directly from the AutoCache class. Here is an example of how to access the preferences cache manager:
With this setup, you can easily manage your application's cache using the methods provided by AutoCache.
Note
Each property of the CacheConfiguration can have a different impact on how the cache behaves. It is important to understand these properties to optimize your application's performance and reliability.
Contributing
The majority of Flutter Auto Cache code is open-source. We are committed to a transparent development process and highly appreciate any contributions. Whether you are helping us fix bugs, proposing new features or improving our documentation.
Bug Report: If you see an error message or encounter an issue while using this package, please create a bug report.
Feature Request: If you have an idea or if there is a capability that is missing and would make development easier and more robust, please submit a feature request.
License
Flutter Auto Cache is licensed under the BSD-3-Clause. This license permits the redistribution and use of the software in source and binary forms, with or without modification, provided that the terms and conditions outlined in the license are met. By using Flutter Auto Cache, you agree to comply with these terms and conditions, which ensure the protection and proper use of the software.