# Error 403 ReferenceId

**URL:** <https://community.prismic.io/t/error-403-referenceid/4923>\
**Category:** Developing with Prismic\
**Created:** [April 12, 2021, 9:18am UTC](https://community.prismic.io/t/error-403-referenceid/4923 "2021-04-12T09:18:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![maobin90](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@maobin90](https://community.prismic.io/u/maobin90)\
**Post date:** [April 12, 2021, 9:18am UTC](https://community.prismic.io/t/error-403-referenceid/4923/1 "2021-04-12T09:18:16Z")

</div>

Hello,

In our application we cache the requests to Prismic and have configured a webhook to clear the caches once there is an update in our repo prismic.

But sometimes the webhook does not work well and we have random errors 403. I suppose that the errors are caused by the fact that we have cached ref and requesting a resource by using an old ref might cause an error 403. Is that right?

Could someone explain exactly how this ref works? I feel that the old ref expires not immediately but in a certain time. During my test, i got a master ref, and then updated a document and published it. The old ref stills worked at the begining and then started provoking 403 errors.

When requesting the prismic document, could we just indicate it is master **lastest** modification that we wanna instead of precising a referenceId which will expire frequently?

thanks,

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [April 16, 2021, 7:26am UTC](https://community.prismic.io/t/error-403-referenceid/4923/3 "2021-04-16T07:26:19Z")

</div>

Hey @maobin90 ,

Yes, an old ref can cause a 403 error. There is no way to request the latest content _without_ the latest ref. This is by design. Prismic API calls are optimized as a two-query process. First, you request the latest ref (which is always completely up-to-date), and then you use that ref to fetch the latest content. In Prismic's development kits, like `@prismicio/client`, every query involves two requests — one for the ref, and another for the content.

I have been told in the past that Prismic caches the past five refs, but I just tested this on my own preview, and found an old ref still working after more than 20 content updates, so I can't say for sure when a ref expires.

I hope this makes sense, but let me know if you have any other questions 🙂

Best,  
Sam

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [April 17, 2021, 7:26am UTC](https://community.prismic.io/t/error-403-referenceid/4923/4 "2021-04-17T07:26:34Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 5:24pm UTC](https://community.prismic.io/t/error-403-referenceid/4923/5 "2021-12-09T17:24:37Z")

</div>


