added directory listing cache

This commit is contained in:
ston1th 2022-03-16 02:37:09 +01:00
commit 4499e88245
5 changed files with 59 additions and 8 deletions

View file

@ -67,10 +67,10 @@ func (fs *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
if !d.IsDir() {
if option == "p" || option == "sp" {
if option == "p" || option == "s" {
if option == "p" {
fs.fs.Preload(p)
} else {
} else if option == "s" {
fs.fs.CancelPreload(p)
}
rdir := "/"