对于BLOB设置有效期限 [英] Set expiry limit for blob

查看:296
本文介绍了对于BLOB设置有效期限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Azure的存储用于存储就像一个缓存机制的信息。因此,对于给定的输入我做了第一次工作,之后我将结果保存在缓存中继续使用。当我需要解决同一给定的输入问​​题,我会直接把它从存储已经准备好解决方案。这一切都被实现。

I'm using Azure-Storage for storing information like a cache mechanism. So, for given input I'm doing the job for first time and after that I'll save the result in the cache for further use. When I'll need to solve the problem with same given input, I'll get it directly the already ready solution from storage. This all is implemented.

我想在我的缓存添加到期限制文件。每个结果将被保存最多30天。在这之后,它们将被自动删除。

I'm trying to add a expiry limit for file in my cache. Each result will be stored for maximum 30 days. After that, they will be automatically deleted.

天真的解决方案也是实现一个后台工作,将每天运行一次,并可以运行在所有文件并删除它们,根据自己的创建时间。

The naive solution is to implement also an background worker that will run one time per day and will run over all files and delete them, according to their creation time.

有更好的解决方案?

推荐答案

我们目前没有为Blob存储自动失效。你的观点,你可以使用类似<一个href=\"http://azure.microsoft.com/en-us/documentation/articles/web-sites-create-web-jobs/\">WebJobs运行一个后台任务删除文件。如果你有大量的创建每一天的文件的简单的方法可能仅仅是创建一个新的容器中的每一天,存储每一天创建该容器中的斑点 - 那么每一天你只是删除31天之久的容器。你也可以做,让你创建一个新表,每天表格类似的东西 - 然后删除该表为31天。

We don't currently have automatic expiration for blob storage. To your point you could use something like WebJobs to run a background task to delete files. If you have a large number of files that you create each day a simpler approach could just be to create a new container each day and store the blobs created each day in that container - then each day you just delete the container that is 31 days old. You could also do something similar with Tables whereby you create a new Table each day - and then delete the Table that is 31 days old.

这篇关于对于BLOB设置有效期限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆