Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

PowerBI report server Cache-Control: no-cache

I'm seeing that on every page load that users are having to download Javascript Assets from PowerBI Report Server from the /assets and /libs folders. I've attempted to add a Cache-Control to the CustomHeaders in SQL Server Management Sudio's advanced property's window as described here: 

https://docs.microsoft.com/en-us/sql/reporting-services/tools/server-properties-advanced-page-report...

 

When I do this however, the assets fail to load. This is an example Custom Header we tried that cuased the problem. Anyone got any experience with applying Caching to the Assets/Library JS files?

 

<CustomHeaders> <Header> <Name>Cache-Control</Name> <Pattern>.+\/libs.+</Pattern> <Value>public, max-age=604800, immutable</Value> </Header> </CustomHeaders>

 

1 ACCEPTED SOLUTION
d_gosbell
Super User
Super User

So you are probably getting an error because you cannot mix the immutable header with no-cache.

 

I'm not sure if the no-cache option is actually very well named the way it is described here https://www.cloudflare.com/learning/cdn/glossary/what-is-cache-control/ is as follows


cache-control: no-cache

This directive means that cached versions of the requested resource cannot be used without first checking to see if there is an updated version. This is typically done using an ETag.

An ETag is another HTTP header which contains a token unique to the version of the resource at the time it was requested. This token is changed on the origin server whenever the resource is updated.

When a user returns to a page with a ‘no-cache’ resource, the client will always have to connect to the origin server and compare the ETag on the cached resource with one on the server. If the ETags are identical, the cached resource will be provided to the user. If not, this means that the resource has been updated and the client will need to download a fresh version to provide to the user. This process ensures that the user is always getting the most up-to-date version of that resource without requiring unnecessary downloads.

 


So you should just be seeing very small requests with 304 responses where the client is just checking that it has the latest version of the resource. I believe this is probably so that any updates, patches or generated bundles get refreshed automatically.

 

I'm seeing requests like the following where require.js gets a 304 response and only 265 bytes (probably just the response headers) is downloaded, not the full 18Kb file. I don't think you want to try and change this behaviour as you will potentially break some pages and you would definitely have issues after applying an update to Report Server.

 

2020-06 http cache-control.png

View solution in original post

1 REPLY 1
d_gosbell
Super User
Super User

So you are probably getting an error because you cannot mix the immutable header with no-cache.

 

I'm not sure if the no-cache option is actually very well named the way it is described here https://www.cloudflare.com/learning/cdn/glossary/what-is-cache-control/ is as follows


cache-control: no-cache

This directive means that cached versions of the requested resource cannot be used without first checking to see if there is an updated version. This is typically done using an ETag.

An ETag is another HTTP header which contains a token unique to the version of the resource at the time it was requested. This token is changed on the origin server whenever the resource is updated.

When a user returns to a page with a ‘no-cache’ resource, the client will always have to connect to the origin server and compare the ETag on the cached resource with one on the server. If the ETags are identical, the cached resource will be provided to the user. If not, this means that the resource has been updated and the client will need to download a fresh version to provide to the user. This process ensures that the user is always getting the most up-to-date version of that resource without requiring unnecessary downloads.

 


So you should just be seeing very small requests with 304 responses where the client is just checking that it has the latest version of the resource. I believe this is probably so that any updates, patches or generated bundles get refreshed automatically.

 

I'm seeing requests like the following where require.js gets a 304 response and only 265 bytes (probably just the response headers) is downloaded, not the full 18Kb file. I don't think you want to try and change this behaviour as you will potentially break some pages and you would definitely have issues after applying an update to Report Server.

 

2020-06 http cache-control.png

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.