Baseflow / flutter_cache_manager

Generic cache manager for flutter
https://baseflow.com
MIT License
740 stars 429 forks source link

Update file_service.dart #308

Closed AITechNassim closed 9 months ago

AITechNassim commented 3 years ago

:sparkles: As not all pages have a maxAge, this parameters allow the user to give a maxAge for the file. This way, the user can manage the file validity.

If fileValidity <0, the filevalidty follows the original logic.

:sparkles: Enhacement Offer the ability to mange the file validity duration

:new: fileService: HttpFileService(fileValidity: int (seconds)) If fileValidity >= 0, the file will be deleted after fileVaildity second(s) else, the current logic is kept

:thinking: Checklist before submitting

renefloor commented 3 years ago

In this case fileValidity is always used when set. Wouldn't it make more sense to use fileValidity only when maxAge is missing?

AITechNassim commented 3 years ago

In this case fileValidity is always used when set. Wouldn't it make more sense to use fileValidity only when maxAge is missing?

You are right. This is can be very interesting.

Is it possible to offer the developer the choice to force the filevalidity ? We can add forceFileValidity (default false). When false it takes the files validity from the headers if any, otherwise it will use fileValidity.

When forceFileValidity is true it will consider only the files validity of the developer.

What do you think?