feat: Add cache clear api route

This commit is contained in:
2025-06-17 23:17:19 +10:00
parent 5b3714f45c
commit ea2bcbb217
5 changed files with 83 additions and 27 deletions

View File

@@ -328,6 +328,19 @@ function extractCidFromRecords(records) {
return null;
}
/**
* Clear the cache for a specific domain
* @param {string} domain - The Handshake domain to clear from cache
*/
function clearCache(domain) {
if (CACHE_ENABLED) {
cache.del(`hns:${domain}`);
console.log(`Cache cleared for ${domain}`);
}
}
module.exports = {
resolveHandshake
resolveHandshake,
clearCache
};