+1-888-365-2779
Try Now
More in this section

Forums / Deployment / Client Cache settings have no affect and neither does cacheControlMaxAge in Web.Config

Client Cache settings have no affect and neither does cacheControlMaxAge in Web.Config

2 posts, 0 answered
  1. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    03 May
    Link to this post

    I've looked at the following link to better understand Sitefinity's client cache settings and after creating my own client cache profile and setting it as the default under System > Output Cache Settings -- Default Client Cache Profile I noticed that it has zero impact on JS or CSS files.  

    Next I found an article on Falafel about setting the cache control max age in the web.config. 

    <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="1.00:00:00" />

    In theory this translates into a client cache setting of one day, or 24 hours, or 86400 seconds. Interestingly though, this setting is not applied to all files. The following lists a file along with the max-age in parenthesis: 

    • Styles.min.css (86400 - 24 hours)
    • Telerik.Web.UI.WebResources (31535796 - 364 days)
    • ResponsiveDesign/layout_transformations.css (Cache-control: public, no max-age)
    • App_Data/Sitefinity/WebsiteTemplates/[Template]/App_Themes/[Theme]/global/bootstrap-custom-grid.css?v=635960492829204356 (Cache-control: public, no max-age)

    In fact, NONE of our custom CSS files in the Global folder of the theme have a max-age set, but looking at Firebug it does have an Expires value of roughly 2 weeks from today.  

     

    So the question is: What's the point of the Client Cache settings in Sitefinity and why does the web.config file setting only apply to Sitefinity assets? 

  2. Jacques
    Jacques avatar
    427 posts
    Registered:
    28 Jun 2007
    03 May in reply to Jacques
    Link to this post

    It would seem that my first comment applies mostly to CSS files, whereas with JS files it seems to be different.  Looking at JS files I see the following: 

    • WebResource.axd (Cache-control: public, max-age: not-set, Expires 1 Year)
    • ScriptResource.axd (Cache-control: public, max-age: not-set, Expires 1 Year)
    • Telerik.Web.UI.WebResource.axd  (Cache-control: public, max-age: 31534795 , Expires 1 Year)
    • Bootstrap.min.js  (Cache-control: public, max-age: not-set, Expires 7 days)
    • Global.js [our own custom file] (Cache-control: public, max-age: 86400, Expires not-set)

     

    All of our custom js files (those not coming from Sitefinity) share the same cache settings as the Global.js in the list above. 

2 posts, 0 answered