Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JIRA 5.2 does not allow caching resources on client side?

Alexej Geldt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 16, 2015

I am working on a plugin which involves ajax (GET) call to a rest service which provides json data. Since that data is not going to change very often and is required on every JIRA page, i came up with idea to have the json data being cached in the browser, in order to reduce the number of roundtrips fetching the same data on every page load.

actually i have expected that JIRA would cache json data by default using some default caching policy. When analyzing the requests and responses in the browser, i fugured out that it does not seem to be the case. 

Instead i was pretty surprised that JIRA seems not to use any browser cache at all.

Network Analysis shows that there is nothing coming from browser cache. All content, even the icons are being refetched on every request.

nocaching.png

Looking at the headers of each response shows that JIRA is setting a header for almost everything:

Cache-Control : "no-cache, no-store, no-transform"

Maybe i am wrong with something, but this looks to me as like JIRA is ignoring the browser cache completely. There might be reasons for this, but this is killing performance - i guess.

Maybe i missed something?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Volodymyr Krupach
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 16, 2015

JSON data fetched from JIRA are dynamic and can change when appropriate values are changed in DB so that is a reason why JIRA adds no-cache headers.

If you need, you can easily cache data in sessionStorage: http://www.w3schools.com/html/html5_webstorage.asp

Alexej Geldt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 16, 2015

i will consider using sessionStorage for caching my json data. Thanks for the hint. However i am concerned about the fact that i don't see any browser cache being used at all. This seems to be the case for firefox only. I have accessed same JIRA instance with chrome and i can see the cache being filled up with icons, js and css content as i expected. The cache in firefox remains empty. I checked the settings, caching is certainly enabled.

Alexej Geldt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 16, 2015

i don't belive it though. After clearing the cache manualy i am expiriencing longer loading times in firefox too. Cache seems to be working, the firefox is just not showing it - i guess.

Alexej Geldt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 16, 2015

tried explicitely setting response header in rest service: @Context final HttpServletResponse response; response.setHeader("Cache-Control", "max-age=2000,public"); this actually appears in response header. But jira still adds its no-cache, no-store parameter

TAGS
AUG Leaders

Atlassian Community Events