elliotgao2/toapi

Docs clarification on cache update logic

Lucas-C opened this issue · 2 comments

Hi.

On the diagram in the README (nice & clear BTW), I can read:

HTML storage update trigger cache update

Could you somehow please explain what that means in the docs ?
When exactly / how does the cache gets updated ?

Thanks for your question which reminds me. Both storage and cache has a attribute timeout, which determine when they should be updated.

When the storage expired, we would remove the html and send a new request to the source site. When the cache expired, we would parse HTML again.

But if the storage get updated and the cache didn't, we couldn't get expected results. We should make
sure that the cache update when the storage update. Meanwhile, give them a new timeout.

So every storaged HTML should have a symbol showing if it is valid.Every time we get cache, we check the symbol.

We haven't finished this right now.

OK. Thanks for the quick answer.