Download pages/api/cache.js from sandy-try/blog: direct link, hf CLI and curl.
- Browser
- Download file 395 Bytes
-
https://huggingface.co/spaces/sandy-try/blog/resolve/main/pages/api/cache.js
- Command line
-
hf download hf://spaces/sandy-try/blog/pages/api/cache.js
-
curl -L -o cache.js https://huggingface.co/spaces/sandy-try/blog/resolve/main/pages/api/cache.js
395 Bytes
| import { cleanCache } from '@/lib/cache/local_file_cache' | |
| /** | |
| * 清理缓存 | |
| * @param {*} req | |
| * @param {*} res | |
| */ | |
| export default async function handler(req, res) { | |
| try { | |
| await cleanCache() | |
| res.status(200).json({ status: 'success', message: 'Clean cache successful!' }) | |
| } catch (error) { | |
| res.status(400).json({ status: 'error', message: 'Clean cache failed!', error }) | |
| } | |
| } | |