fiber icon indicating copy to clipboard operation
fiber copied to clipboard

📝 [Proposal]: Allow disabling cache for ctx.SendFile()

Open bpatyi opened this issue 1 year ago • 2 comments

Question Description

hello. Is there any way to turn off the ctx.SendFile cache? In our project, we further distribute files to devices in chunks, which can change every second. If I understand the code correctly, it is currently fixed to cache for 10 seconds, which causes it to arrive incorrectly. Thanks for your help.

Code Snippet (optional)

No response

Checklist:

  • [X] I agree to follow Fiber's Code of Conduct.
  • [X] I have checked for existing issues that describe my questions prior to opening this one.
  • [X] I understand that improperly formatted questions may be closed without explanation.

bpatyi avatar Mar 28 '24 15:03 bpatyi

@bpatyi This would need to be added as a feature in v3. The filesystem middleware problably needs the same feature.

gaby avatar Mar 30 '24 04:03 gaby

While we are at it, there's no unit-tests for the compress param.

https://github.com/gofiber/fiber/blob/main/ctx_test.go

gaby avatar Mar 30 '24 04:03 gaby