feat(16.2-07): purge the host site cache on every admin post and category write
- posts: FormAfterCreate/Update purge after the content_html translations, new FormAfterDelete; categories: FormAfterCreate and FormAfterDelete - NewSiteCachePurger refuses half configuration, non-http(s) URLs, user info, fragments, http to a non-loopback host and tokens under 32 chars; Boot logs the endpoint host and path once - TestPostsAdminPurgesSiteCache smoke test - README: Configuration section (keys, contract, timing, scope), API rows
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"io/fs"
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
@@ -74,7 +75,11 @@ func (p *Plugin) wireSiteCache(app *backpack.App) error {
|
||||
if purger == nil {
|
||||
return nil
|
||||
}
|
||||
return app.Publish(purger)
|
||||
if err := app.Publish(purger); err != nil {
|
||||
return err
|
||||
}
|
||||
slog.Default().Info("journal: site cache purge enabled", "endpoint", purger.Endpoint())
|
||||
return nil
|
||||
}
|
||||
|
||||
func (p *Plugin) LangFS() fs.FS { return langFS }
|
||||
|
||||
Reference in New Issue
Block a user