# Mautic, NGINX and JS browser cache headers

**URL:** <https://forum.mautic.org/t/mautic-nginx-and-js-browser-cache-headers/22992>\
**Category:** Product Support\
**Created:** [March 10, 2022, 6:49pm UTC](https://forum.mautic.org/t/mautic-nginx-and-js-browser-cache-headers/22992 "2022-03-10T18:49:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ricksimnett](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ricksimnett/32/1578_2.png) [@ricksimnett](https://forum.mautic.org/u/ricksimnett)\
**Post date:** [March 10, 2022, 6:49pm UTC](https://forum.mautic.org/t/mautic-nginx-and-js-browser-cache-headers/22992/1 "2022-03-10T18:49:24Z")

</div>

**Your software**  
My Mautic version is: 4.2  
My PHP version is: 7.4  
My Database type and version is: Mysql 8

**Your problem**  
My problem is: I want to add cache headers to the response for /forms/form.js requests. But my settings dont seem to work.

These errors are showing in the log:  
n/a

Steps I have tried to fix the problem:

Tried adding expires directive to multiple blocks within the nginx config. Havent really gotten anywhere with it.

Latest attempt was:

location ~ (.\*).js {  
try\_files $uri /index.php?$args;  
expires 15d;  
}

Im not sure if perhaps its the query string throwing it off at this point? Although I think the above block accounts for that, stating that ALL matches to this rule get an expires header of 15d…

Any help is appreciated.

Thanks,  
Rick
