feat: 前台整页响应缓存(匿名 GET,浏览量走 track-view 独立端点)+ 后台缓存管理页 + 侧边栏 nav-groups 负 margin 归零

This commit is contained in:
ak
2026-08-11 21:53:09 +08:00
parent a5429b3ea4
commit 7622cd8e2a
21 changed files with 317 additions and 1 deletions
+3
View File
@@ -35,6 +35,9 @@ Route::get('/posts/{slug}.shtml', [PostController::class, 'show'])->where('slug'
Route::get('/posts/{slug}', fn (string $slug) => redirect()->route('posts.show', $slug, 301))->where('slug', '[A-Za-z0-9\-]+');
Route::post('/posts/{post}/comments', [CommentController::class, 'store'])->name('comments.store');
// 浏览量统计(独立端点,避开整页缓存,保证实时)
Route::get('/track-view/{post}', fn (\App\Models\Post $post) => response($post->increment('views') ? '' : '', 204))->name('track-view');
Route::get('/category/{slug}.shtml', [CategoryController::class, 'show'])->where('slug', '[A-Za-z0-9\-]+')->name('category.show');
Route::get('/category/{slug}', fn (string $slug) => redirect()->route('category.show', $slug, 301))->where('slug', '[A-Za-z0-9\-]+');