# Cache control does not change

**URL:** <https://forum.builder.io/t/cache-control-does-not-change/6045>\
**Category:** Technical Questions\
**Tags:** nextjs\
**Created:** [July 25, 2024, 5:04am UTC](https://forum.builder.io/t/cache-control-does-not-change/6045 "2024-07-25T05:04:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tlee-pb](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@tlee-pb](https://forum.builder.io/u/tlee-pb)\
**Post date:** [July 25, 2024, 5:04am UTC](https://forum.builder.io/t/cache-control-does-not-change/6045/1 "2024-07-25T05:04:30Z")

</div>

**Builder content link**

- [Builder.io: Visual Development Platform](https://builder.io/content/08cd0da49340417c87bee1a1330d8d82)
- [Productboard](https://pb-website-next-hgham1ngj-pb-website.vercel.app/dummy/)

**Builder public api key**  
1d8ecee591ac4358befb8fe998100548

**What are you trying to accomplish**

- I followed this [doc](https://www.builder.io/c/docs/content-api#code-stale-cache-seconds-code) and added “cacheSeconds” and “staleCacheSeconds” as the doc recommend, but when previewing the page in our local environment, the cache control does not reflect.

```auto
export const getPageModelData = async (slug: string) => {
  const pageData = await builder
    .get('page', {
      userAttributes: {
        urlPath: slug,
      },
      cacheSeconds: 3600,
      staleCacheSeconds: 86400,
      prerender: false,
      options: {
        enrich: true,
      },
    })
    .toPromise();

  return pageData;
};

```

 ![Screenshot 2024-07-24 at 10.02.14 PM](https://us1.discourse-cdn.com/flex020/uploads/builder/original/2X/1/181ef59ecf57be4df2466182d8a432b11c536f12.jpeg)

**Code stack you are integrating Builder with**  
“next”: “14.1.3”, “@builder.io/react”: "~3.1.2

---

<div class="post-metadata">

**Author:** ![Stephane](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stephane](https://forum.builder.io/u/Stephane)\
**Post date:** [August 23, 2024, 1:28pm UTC](https://forum.builder.io/t/cache-control-does-not-change/6045/4 "2024-08-23T13:28:41Z")

</div>

Hi @tlee-pb - I should clarify that our settings only update the API request cache headers, your site’s response headers are controlled by next.js.  
Sorry for the confusion.

---

<div class="post-metadata">

**Author:** ![tlee-pb](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@tlee-pb](https://forum.builder.io/u/tlee-pb)\
**Post date:** [August 24, 2024, 12:06am UTC](https://forum.builder.io/t/cache-control-does-not-change/6045/5 "2024-08-24T00:06:56Z")

</div>

Hello @Stephane, do you have an example in the Builder’s GitHub for NextJs on the both (NextJs and [Builder.io](http://Builder.io)) cache setup. I am interested to know what would be the recommended pattern for setting up cache with Builder and Next 14.

Thank you so much for the help. 🙏

---

<div class="post-metadata">

**Author:** ![Stephane](https://avatars.discourse-cdn.com/v4/letter/s/dfb087/32.png) [@Stephane](https://forum.builder.io/u/Stephane)\
**Post date:** [September 4, 2024, 10:53am UTC](https://forum.builder.io/t/cache-control-does-not-change/6045/6 "2024-09-04T10:53:15Z")

</div>

Hi @tlee-pb -

Next.js framework is outside of our scope of what Builder would provide direct support or documentation.

However, here is the Next documentation on caching:

- [Building Your Application: Caching | Next.js](https://nextjs.org/docs/app/building-your-application/caching)
- as well as setting the [cache-control header](https://nextjs.org/docs/pages/api-reference/next-config-js/headers#cache-control)

Hope this helps.

---

<div class="post-metadata">

**Author:** ![tlee-pb](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@tlee-pb](https://forum.builder.io/u/tlee-pb)\
**Post date:** [September 4, 2024, 9:20pm UTC](https://forum.builder.io/t/cache-control-does-not-change/6045/7 "2024-09-04T21:20:00Z")

</div>

Thank you so much for the assist~
