This is a migrated thread and some comments may be shown as answers.

Telerik.Web.UI.WebResource.axd & Last-Modified

5 Answers 269 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rich
Top achievements
Rank 1
Rich asked on 27 Nov 2017, 08:47 PM

 Using RadScriptManager and EnableScriptCombine="true" I get a response header for Telerik.Web.UI.WebResource.axd of Tue, 11 Jul 2017 00:00:00 GMT.

 Where does that date/time come from?

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 30 Nov 2017, 02:33 PM

Hi Rich,

Here is the code that sets the cacheability of the combined resource:

HttpCachePolicy cache = Response.Cache;
cache.SetCacheability(HttpCacheability.Public);
cache.VaryByParams[ScriptEntry.HiddenFieldParamName] = true;
cache.VaryByParams[ScriptEntry.CombinedScriptsParamName] = true;
cache.VaryByParams[CompressParameterName] = true;
cache.VaryByHeaders["User-Agent"] = true;
cache.SetOmitVaryStar(true);
cache.SetExpires(DateTime.Now.AddDays(DaysToCache));
cache.SetMaxAge(TimeSpan.FromDays(DaysToCache));
cache.SetLastModified(GetLastModifiedDate());
cache.SetValidUntilExpires(true);

I believe the date you get is the last moment in time when the scripts were modified for that page (controls collection changed or external scripts that are combined were modified).

Considering the most common case - this is the date on which the Telerik.Web.UI assembly your application uses was built.

Regards,

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Rich
Top achievements
Rank 1
answered on 11 Dec 2017, 04:01 PM
Thanks Marin, that's great. One more question. The header also includes Vary:User-Agent, does the RadScriptManager vary the scripts in the combined resource based on User-Agent? In my very limited testing (Chrome/FireFox/IE) it seems to return the same combined script.
0
Rumen
Telerik team
answered on 11 Dec 2017, 04:19 PM
Hi there,

You can expect different set of scripts only on a mobile device.

Best regards,
Rumen
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Rich
Top achievements
Rank 1
answered on 13 Dec 2017, 02:10 PM
Is there a way to have that header not appear? In testing, with the scripts we are using it does not appear to vary between desktop and phones/tablets.
0
Marin Bratanov
Telerik team
answered on 14 Dec 2017, 01:49 PM

Hi Rich,

You can find the following line:

cache.VaryByHeaders["User-Agent"] = true;

in the Telerik.Web.UI\Common\ScriptManager\CombinedScriptsWriter.cs(338):  file so you can download our source code and rebuild it with the changes you require.

Variations are likely to occur if you are using controls that have a mobile-specific render mode (list here) and you use that mode.

I advise, however, that you consider using the CDNs we offer to improve caching:


Regards,

Marin Bratanov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
General Discussions
Asked by
Rich
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Rich
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or