# Expiring header fotrHTTP in node

**URL:** <https://discourse.nodered.org/t/expiring-header-fotrhttp-in-node/45400>\
**Category:** General\
**Created:** [9 May 2021 21:08 UTC](https://discourse.nodered.org/t/expiring-header-fotrhttp-in-node/45400 "2021-05-09T21:08:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nehemiascr](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nehemiascr/32/43238_2.png) [@nehemiascr](https://discourse.nodered.org/u/nehemiascr)\
**Post date:** [9 May 2021 21:08 UTC](https://discourse.nodered.org/t/expiring-header-fotrhttp-in-node/45400/1 "2021-05-09T21:08:12Z")

</div>

Hello, I have a simple http request that serves a pdf file that gets generated and overwritten often, my problem is that all browsers serve a cached version of the file, not the newer file in the server, how can I fix this? I read online that such problem can be fixed with configuring expiring headers in a .htaccess file, but my understanding is that the .htaccess file is an Apache file, so this wouldn't work in node-red, any idea on how to solve this ? thanks in advance ✌

 ![Screen Shot 2021-05-09 at 16.58.20](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/d/5dd3d95df56109dcadeb02b37507208144c4ac81.png)

---

<div class="post-metadata">

**Author:** ![nehemiascr](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nehemiascr/32/43238_2.png) [@nehemiascr](https://discourse.nodered.org/u/nehemiascr)\
**Post date:** [9 May 2021 21:34 UTC](https://discourse.nodered.org/t/expiring-header-fotrhttp-in-node/45400/2 "2021-05-09T21:34:55Z")

</div>

I found the solution in [Cache headers in Express js app](https://regbrain.com/article/cache-headers-express-js)

I added two headers to the response node

 ![Screen Shot 2021-05-09 at 17.37.26](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/b/3be3521697b00be16cc016797a75993ae7866c8c.png)

I would appreciate to know if there's a better solution.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [8 July 2021 21:35 UTC](https://discourse.nodered.org/t/expiring-header-fotrhttp-in-node/45400/3 "2021-07-08T21:35:25Z")

</div>

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