# Is there an issue with cache headers for .umd.js file in contributed D2 ui nodes?

**URL:** <https://discourse.nodered.org/t/is-there-an-issue-with-cache-headers-for-umd-js-file-in-contributed-d2-ui-nodes/88123>\
**Category:** Dashboard\
**Tags:** dashboard-2\
**Created:** [20 May 2024 14:19 UTC](https://discourse.nodered.org/t/is-there-an-issue-with-cache-headers-for-umd-js-file-in-contributed-d2-ui-nodes/88123 "2024-05-20T14:19:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 May 2024 14:19 UTC](https://discourse.nodered.org/t/is-there-an-issue-with-cache-headers-for-umd-js-file-in-contributed-d2-ui-nodes/88123/1 "2024-05-20T14:19:09Z")

</div>

I use Cloudflare Zero Trust so Cloudflare caches served files. I just had an issue following the update of a node I am developing that, following an update to the node, cloudflare did not refresh the .umd.js file for the node. I had to tell cloudflare to clear the cache for it be picked up. Reading the docs I think Cloudflare uses the caching headers to tell it when it should refresh a file, so I wonder whether we are setting the correct headers for that file.

I also had to manually clear the cache in the browser, so perhaps that is also related.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [20 May 2024 15:47 UTC](https://discourse.nodered.org/t/is-there-an-issue-with-cache-headers-for-umd-js-file-in-contributed-d2-ui-nodes/88123/2 "2024-05-20T15:47:06Z")

</div>

I don't know much about this subject, but a bit of googling looking at the developer tools suggests that the .umd.js file is served with no cache-control header at all. For comparison, with the old dashboard, the file app.min.js has cache-control headers `public,max-age=0` which indicates that the file should not be cached.

Reading the Cloudflare docs it says that if there is no cache-control specified that Cloudflare defaults to a 2 hour expiry time, which would explain the symptom I am seeing.

I think that the umd.js file should have the same cache-control settings as app.min.js. If anyone who knows anything about this agrees that I have interpreted the situation correctly then I will raise an issue.

---

<div class="post-metadata">

**Author:** ![joepavitt](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joepavitt/32/59722_2.png) [@joepavitt](https://discourse.nodered.org/u/joepavitt)\
**Post date:** [21 May 2024 08:02 UTC](https://discourse.nodered.org/t/is-there-an-issue-with-cache-headers-for-umd-js-file-in-contributed-d2-ui-nodes/88123/3 "2024-05-21T08:02:44Z")

</div>

Please do raise an issue and link to it here once it's written

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [21 May 2024 15:10 UTC](https://discourse.nodered.org/t/is-there-an-issue-with-cache-headers-for-umd-js-file-in-contributed-d2-ui-nodes/88123/4 "2024-05-21T15:10:08Z")

</div>

Done [Add cache-control records to served files, particularly contrib ui node .m · Issue #879 · FlowFuse/node-red-dashboard · GitHub](https://github.com/FlowFuse/node-red-dashboard/issues/879)

---

<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:** [20 June 2024 15:10 UTC](https://discourse.nodered.org/t/is-there-an-issue-with-cache-headers-for-umd-js-file-in-contributed-d2-ui-nodes/88123/5 "2024-06-20T15:10:24Z")

</div>

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