This is a migrated thread and some comments may be shown as answers.
StyleSheetRegistrar cannot set Last-Modified header
8 Answers 41 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jack
Top achievements
Rank 1
Jack asked on 30 Dec 2010, 10:11 PM
I have an MVC site where I am using the MVC Telerik grid as well as Html.Telerik().StyleSheetRegistrar(). In the StyleSheetRegistrar I specify CacheDurationInDays(365) but if I take the URL for the asset.asx and paste it in Fiddler I get the following if I select the "Caching" tab:

This response does not specify an explicit expiration time and does not specify a Last-Modified date. This will force most browsers to revalidate this resource's freshness on every use because heuristic expiration is typically based on Last-Modified date.
This response contains neither an ETAG nor a Last-Modified time. This will prevent a Conditional Revalidation of this response.


The reason I am looking into this is because I have had complaints that the site sometimes renders the complete page without any styles(they did send screen-shots) The site is behind a secure login so I cannot post the URL here. How can I get this to stop happening? Moving the styles inline or to an internal styles block is going to be a pain.

The server is running IIS7 and I do no updates unless it is to fix a problem.

8 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 03 Jan 2011, 10:23 AM
Hi Jack,

The caching of web assets is disabled when the application is running in debug mode (<compilation debug="true">). Setting it to false should fix the problem.

Please refer to this help topic for more information - Working with JavaScript web assets.

Best regards,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jack
Top achievements
Rank 1
answered on 03 Jan 2011, 03:12 PM
Thank you Tsvetomir,
my web.config does have that entry and it is set to debug="false" and still nothing. Could this be some IIS7 issue?

Thank you
Jack
0
T. Tsonev
Telerik team
answered on 03 Jan 2011, 03:44 PM
Hello Jack,

I've double-checked and the <compilation debug="..."/> setting is the only thing that is taken into account when setting the response headers.

Can you please send us a stripped-down version of the project that reproduces the problem? This will help us a lot with tracking down the issue.

Regards,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jack
Top achievements
Rank 1
answered on 03 Jan 2011, 05:39 PM
I paste the call to the asset.asd into Fiddler: http://portal2.ravenslingshot.com/asset.axd?id=DAEAAB-LCAAAAAAABADtvQdgHEmWJSYvbcp7f0r1StfgdKEIgGATJNiQQBDswYjN5pLsHWlHIymrKoHKZVZlXWYWQMztnbz33nvvvffee--997o7nU4n99__P1xmZAFs9s5K2smeIYCqyB8_fnwfPyJ-8UfT9qNHH7X5u_butGk-Gn10SX_u7ezujHfH93Ye0gfTjx619TqnX2YfPbr36f3RR_Tze7_4oxU1PKmWbb5sqdU5f1Z99Ghn9NGSIZZ5XbwdT6vFolqOAfuXjLjBbtigKRarMvcb3JMGTXtd5o3_xb58UVCfdVHV8tX38aWHy93qMq-nWRMgtSdv_vQvWuf19fa62N4dH4yn66atFgbK93_J_wMHbm8MDAEAAA%3d%3d

And the cache-control is private (I want it public so that the client caches it)

I also get the following from the Fiddler Caching tab: This response does not specify an explicit expiration time and does not specify a Last-Modified date. This will force most browsers to revalidate this resource's freshness on every use because heuristic expiration is typically based on Last-Modified date.
This response contains neither an ETAG nor a Last-Modified time. This will prevent a Conditional Revalidation of this response.
0
T. Tsonev
Telerik team
answered on 04 Jan 2011, 09:35 AM
Hi Jack,

Thank you for the live URL, but unfortunately I'm unable to test it because it requires authentication.

Let's try this the other way around - I'm sending you a very basic project with debugging turned off. The assets are cached as expected. Can you please try to modify it to replicate the behavior you're getting in your project?

Regards,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jack
Top achievements
Rank 1
answered on 04 Jan 2011, 03:24 PM
Thank you Tsvetomir,
I ran it and I can see in Firebug that no request is made to assets.axd if I navigate to the URL (on the project and my site) but when I hit F5 the call is made to assets.axd (as expected) I just have 1 question:

1: It does seem that the call to assets.axd does not get served (timeout??) in some cases. It is very rare but I have seen it before. Will this be an IIS7 issue or Telerik StyleSheetRegistrar?

Thank you for the help.
Jack
0
Accepted
T. Tsonev
Telerik team
answered on 04 Jan 2011, 04:39 PM
Hello Jack,

We're not aware of any timeout issues with the asset.axd handler.

What kind of HTTP error do you get in the case where the request to asset.axd does not get served? If the request is entirely missing from the Firebug / Fiddler log then it might be loaded from cache.

Regards,
Tsvetomir Tsonev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Jack
Top achievements
Rank 1
answered on 04 Jan 2011, 04:42 PM
The only error is the fact that the page loads without the styles. The only way for me to debug this(it is very rare) is to wait for a complaint and then go do some log mining in IIS.

Thanks for the help, I consider this matter as resolved.

Jack
Tags
Grid
Asked by
Jack
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Jack
Top achievements
Rank 1
Share this question
or