<p>I am trying to develop caching mechanism which would cache image for the golang web server. Any ideas how to do this.
I found about groupcache but don't know how to use it. Any tutorials or examples are welcomed.</p>
<hr/>**评论:**<br/><br/>pierrrre: <pre><p><a href="https://github.com/pierrre/imageserver" rel="nofollow">https://github.com/pierrre/imageserver</a></p></pre>madman2233: <pre><p>Quick method i used before is to have a global map[string][]byte to store the images, string is a hash of the uri for the file. With a sync.rwmutex. Now i use <a href="https://github.com/diegobernardes/ttlcache" rel="nofollow">https://github.com/diegobernardes/ttlcache</a></p></pre>joshuaprunier: <pre><p>This blog post does a really good job explaining how groupcache works as a client/server. They also have a github repo example to play with. Groupcache is really cool but could be overkill depending on what exactly you are trying to accomplish.</p>
<p><a href="http://capotej.com/blog/2013/07/28/playing-with-groupcache/" rel="nofollow">http://capotej.com/blog/2013/07/28/playing-with-groupcache/</a></p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
0 回复
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传