+caching layer for sorted alms

This commit is contained in:
Simon Martens
2026-01-12 20:22:00 +01:00
parent bcf7d1847d
commit 9dd1fcd8ce
3 changed files with 59 additions and 3 deletions

View File

@@ -190,6 +190,9 @@ func (p *AlmanachEditPage) POSTSave(engine *templating.Engine, app core.App) Han
})
}
// Invalidate sorted entries cache since entry was modified
InvalidateSortedEntriesCache()
// Check if fields that affect contents changed
contentsNeedUpdate := entry.PreferredTitle() != oldPreferredTitle ||
entry.Year() != oldYear ||
@@ -290,6 +293,9 @@ func (p *AlmanachEditPage) POSTDelete(engine *templating.Engine, app core.App) H
})
}
// Invalidate sorted entries cache since entry was deleted
InvalidateSortedEntriesCache()
// Delete from FTS5 index asynchronously
go func(appInstance core.App, entryID string) {
if err := dbmodels.DeleteFTS5Entry(appInstance, entryID); err != nil {