flutter_cache_manager icon indicating copy to clipboard operation
flutter_cache_manager copied to clipboard

Update file_service.dart

Open AITechNassim opened this issue 4 years ago • 2 comments

: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

  • [x] All projects build
  • [x] Follows style guide lines (code style guide)
  • [ ] Relevant documentation was updated
  • [ ] Rebased onto current develop

AITechNassim avatar Apr 28 '21 13:04 AITechNassim

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

renefloor avatar Apr 30 '21 10:04 renefloor

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?

AITechNassim avatar May 14 '21 23:05 AITechNassim