feat: implement detail caching for news articles to optimize content fetching
This commit is contained in:
@@ -26,6 +26,8 @@ news_service/
|
||||
mainnews.json
|
||||
ranknews.json
|
||||
worldnews.json
|
||||
detail-cache.json
|
||||
images/
|
||||
src/
|
||||
app/
|
||||
config/
|
||||
@@ -110,6 +112,12 @@ POST /api/news/refresh
|
||||
POST /api/news/refresh?category=flashnews
|
||||
```
|
||||
|
||||
## 缓存
|
||||
|
||||
- 分类列表和前端返回数据会落盘到 `data/<category>.json`。
|
||||
- 详情正文会按详情页 URL 去重缓存到 `data/detail-cache.json`,同一篇新闻后续刷新不会重复抓详情页。
|
||||
- 正文图片会下载到 `data/images/`,正文 HTML 里的图片地址会替换成 `/api/news/images/<file>`。
|
||||
|
||||
## Docker
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user