implemented priority preloading
This commit is contained in:
parent
86bd1cd1e5
commit
eb6272e411
7 changed files with 134 additions and 107 deletions
|
|
@ -85,11 +85,16 @@ func (fs *FileServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
|
||||
if !d.IsDir() {
|
||||
if option == "p" || option == "s" {
|
||||
if option == "p" {
|
||||
fs.fs.Preload(p)
|
||||
} else if option == "s" {
|
||||
fs.fs.CancelPreload(p)
|
||||
if option == "p" || option == "i" || option == "d" || option == "s" {
|
||||
switch option {
|
||||
case "p":
|
||||
fs.fs.Preload(p, 0)
|
||||
case "i":
|
||||
fs.fs.Preload(p, 1)
|
||||
case "d":
|
||||
fs.fs.Preload(p, -1)
|
||||
case "s":
|
||||
fs.fs.RemovePreload(p)
|
||||
}
|
||||
rdir := "/"
|
||||
if r.FormValue("r") == "preloads" {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue