3 ms·
Yes, you could potentially do something like that. A cache is only in essence "I keep a local store, if someone asks for something which is already in the local
by kolektiv 7y ago
Yes, you could potentially do something like that. A cache is only in essence "I keep a local store, if someone asks for something which is already in the local store, I give them that - if not, I go and get it, put it in the local store for the next person that wants it, and then give them that". Of course, having things expire (knowing when to remove them from the cache) is not a trivial problem, but there's a lot of prior art out there (look for "cache expiry") and there's also quite a lot built in to HTTP to ensure that HTTP content can be cached well (proxies are a very common thing - look in to "HTTP cache headers").
Of course, in your case, it might be debatable in terms of utility - if you're trying to replace a scan, you probably are trying to get results as "up to date" as you can - which would be prevented if the cache avoided doing that! The cache would have the same rate limits, and so you would be just as well off adjusting the frequency you currently scan. Of course, if you can't control that frequency (perhaps multiple uncoordinated scanners) a proxy is one way to give you that control - so maybe useful!