# How to read from cache only using onebox gem?

**URL:** https://meta.discourse.org/t/how-to-read-from-cache-only-using-onebox-gem/116121
**Category:** Development
**Created:** [April 27, 2019, 8:11am UTC](https://meta.discourse.org/t/how-to-read-from-cache-only-using-onebox-gem/116121 "2019-04-27T08:11:07Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![enigmaty](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/enigmaty/32/65626_2.png) [@enigmaty](https://meta.discourse.org/u/enigmaty)
#### Post date: [April 27, 2019, 8:11am UTC](https://meta.discourse.org/t/how-to-read-from-cache-only-using-onebox-gem/116121/1 "2019-04-27T08:11:07Z")

</div>

I am using onebox as standalone gem. In my use case I want to read from cache only. Is there an easy way to fetch urls from cache only without any network hit?

I am using Rails 5.1.

Thanks.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [April 30, 2019, 9:57am UTC](https://meta.discourse.org/t/how-to-read-from-cache-only-using-onebox-gem/116121/2 "2019-04-30T09:57:14Z")

</div>

While the onebox gem has an internal cache, it’s best for the user of the library to handle what should be cached and for how long.
