rejetto / hfs

HFS is a web file server to run on your computer. Share folders or even a single file thanks to the virtual file system.
GNU General Public License v3.0
2.29k stars 227 forks source link

"dont cache" checkbox for folders #492

Open W-i-n-7 opened 9 months ago

W-i-n-7 commented 9 months ago

i have multiple html enabled folders (web folders) and some i dont want to be cached to user's browsers such as my shortened urls folder rejetto came up with server code that will disable caching but i thought there should be a check box that appears if index.html is enabled in the admin panel next to it saying "dont cache" or "no caching" that would do the same as this server code:

exports.middleware = ctx => { if (ctx.path.startsWith('/shrt')) ctx.set('etag', '') ctx.set('Cache-Control', 'no-store, no-cache, must-revalidate') }

W-i-n-7 commented 9 months ago

i think this can be a plugin too

rejetto commented 9 months ago

was your problem caused by having url?parameters ?

W-i-n-7 commented 9 months ago

what?

W-i-n-7 commented 9 months ago

no

rejetto commented 9 months ago

ok, so what's causing the need actually? if you can't say that, do you need "index.html" to not be cached? if yes, is the file changing on disk?

W-i-n-7 commented 9 months ago

yeah it can change in my use on the shortened links this isnt anything that already couldnt be done because of the server code

im just throwing all my ideas at the wall and seeing what sticks 😀