mwrock / RequestReduce

Instantly makes your .net website faster by reducing the number and size of requests with almost no effort.
www.requestreduce.org
Apache License 2.0
228 stars 49 forks source link

Styles and scripts not combined #185

Closed itotm closed 12 years ago

itotm commented 12 years ago

I'm using RequestReduce in combination with Ext.Net, which adds his own styles and scripts. I also have some custom includes. I reorderd the items in the header, but not all are combined, this is what I get:

<head><title>
    ***title***
</title><link href="/RequestReduceContent/f56d9dcee2b7c7b635ef80647c2d69ba-af2508e0065475a0d43df897d875a03f-RequestReducedStyle.css" rel="Stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/extjs/resources/css/ext-all-embedded-css/ext.axd?v=43009" />

    <link rel="stylesheet" type="text/css" href="/ux/extensions/lockinggrid/css/LockingGridView-css/ext.axd?v=43009" />

    <link rel="stylesheet" type="text/css" href="/ux/plugins/commandcolumn/commandcolumn-embedded-css/ext.axd?v=43009" />

    <link rel="stylesheet" type="text/css" href="/ux/extensions/fileuploadfield/css/file-upload-css/ext.axd?v=43009" />

    <script src="/RequestReduceContent/36cbd3c4d08acdc54501fedfa4d7d5cb-8ec6187d7d105456cd4dbfe7f605fb35-RequestReducedScript.js" type="text/javascript" ></script>                 
<script src="/RequestReduceContent/50b69a28093e32c20a8828fe6b4727b6-b6132a02a398112551eac39bed9ddcac-RequestReducedScript.js" type="text/javascript" ></script></head>

disabling RequestReduce the header is:

<head><title>
    ***title***
</title><link href="/ExtranetBase.axd?res=ExtranetBase.css&amp;v=1206011140" rel="stylesheet" type="text/css" /><link href="/include/Common.css?v=1206011140" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="/extjs/resources/css/ext-all-embedded-css/ext.axd?v=43009" />

    <link rel="stylesheet" type="text/css" href="/ux/extensions/lockinggrid/css/LockingGridView-css/ext.axd?v=43009" />

    <link rel="stylesheet" type="text/css" href="/ux/plugins/commandcolumn/commandcolumn-embedded-css/ext.axd?v=43009" />

    <link rel="stylesheet" type="text/css" href="/ux/extensions/fileuploadfield/css/file-upload-css/ext.axd?v=43009" />

    <script type="text/javascript" src="/extjs/adapter/ext/ext-base-debug-js/ext.axd?v=43009"></script>
    <script type="text/javascript" src="/extjs/ext-all-debug-js/ext.axd?v=43009"></script>
    <script type="text/javascript" src="/extnet/extnet-core-debug-js/ext.axd?v=43009"></script>
    <script type="text/javascript" src="/extnet/locale/ext-lang-it-js/ext.axd?v=43009"></script>
    <script type="text/javascript" src="/extnet/extnet-data-debug-js/ext.axd?v=43009"></script>
    <script type="text/javascript" src="/ux/extensions/lockinggrid/LockingGridView-js/ext.axd?v=43009"></script>
<script id="ExtranetBase.js" type="text/javascript" src="/ExtranetBase.axd?res=ExtranetBase.js&amp;v=1206011140"></script><script id="ExtranetBase_ExtNet.js" type="text/javascript" src="/ExtranetBase.axd?res=ExtranetBase_ExtNet.js&amp;v=1206011140"></script><script id="Common" type="text/javascript" src="/include/Common.js?v=1206011140"></script><script id="PaginaIncarico.js" type="text/javascript" src="/PopupIncarico/PaginaIncarico.js?v=1206011140"></script><base target="_self" /><script id="~/PopupIncarico/DatiIncarico/TabDatiIncarico.js" type="text/javascript" src="/PopupIncarico/DatiIncarico/TabDatiIncarico.js?v=1206011140"></script><script id="~/PopupIncarico/Note/TabNote.js" type="text/javascript" src="/PopupIncarico/Note/TabNote.js?v=1206011140"></script><script id="~/PopupIncarico/Documenti/TabDocumenti.js" type="text/javascript" src="/PopupIncarico/Documenti/TabDocumenti.js?v=1206011140"></script></head>

Is there a bug or should I try to modify something?

Thanks, Fabrizio

mwrock commented 12 years ago

Does the ext css have a text/css mime type in its response header?

itotm commented 12 years ago

Hi,

yes, these are the headers as reported by fiddler for

/extjs/resources/css/ext-all-embedded-css/ext.axd?v=43009

HTTP/1.1 200 OK Cache-Control: public, must-revalidate, max-age=31536000 Content-Type: text/css; charset=utf-8 Expires: Sat, 01 Jun 2013 15:42:05 GMT Last-Modified: Fri, 06 Apr 2012 10:15:36 GMT Server: Microsoft-IIS/7.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Date: Fri, 01 Jun 2012 15:42:05 GMT Content-Length: 144943

On Fri, Jun 1, 2012 at 5:19 PM, Matt Wrock < reply@reply.github.com

wrote:

Does the ext css have a text/css mime type in its response header?


Reply to this email directly or view it on GitHub: https://github.com/mwrock/RequestReduce/issues/185#issuecomment-6062909

mwrock commented 12 years ago

ok. thanks. that is odd. Is there any kind of security on those resources that would prevent an unauthenticated user from getting to them? Can you check the RR dashboard to see if it reports any errors trying to pull down those resources?

itotm commented 12 years ago

hi, I'see on monday when I'll be back to work. I don't think it's an authentication problem, the behaviour is the same debugging in visual studio and running on a server. Would it be useful a test application? I reordered Ext.net scripts and mines, using it in the default way gives a different order of the includes.

On 01/giu/2012, at 18:24, Matt Wrock reply@reply.github.com wrote:

ok. thanks. that is odd. Is there any kind of security on those resources that would prevent an unauthenticated user from getting to them? Can you check the RR dashboard to see if it reports any errors trying to pull down those resources?


Reply to this email directly or view it on GitHub: https://github.com/mwrock/RequestReduce/issues/185#issuecomment-6064433

itotm commented 12 years ago

Hi, the dashboard does not contain any error. I did a small example to reproduce the problem, it's here: http://dl.dropbox.com/u/9262727/RR-ExtNet-Test.zip

On Fri, Jun 1, 2012 at 6:23 PM, Matt Wrock < reply@reply.github.com

wrote:

ok. thanks. that is odd. Is there any kind of security on those resources that would prevent an unauthenticated user from getting to them? Can you check the RR dashboard to see if it reports any errors trying to pull down those resources?


Reply to this email directly or view it on GitHub: https://github.com/mwrock/RequestReduce/issues/185#issuecomment-6064433

mwrock commented 12 years ago

thanks. I'll take a look.

mwrock commented 12 years ago

Sorry for the delay here. Reverse the order that the two modules are declared in your web.config putting the RequestReduce module first. The ext directrequestmodule is somehow manipulating the response in such a way that causes RequestReduce not to see the css.

itotm commented 12 years ago

Hi, thanks for your support. Putting the module first works, but something strange happens to the css. It seems that the browser does not read the file entirely, but only in part. I updated the example to show the behaviour: http://dl.dropbox.com/u/9262727/RR-ExtNet-Test.zip

I think the problem is this line .x-panel-reset .x-panel-body br:before { content: "\A" }

that in the minified css becomes .x-panel-reset .x-panel-body br:before{content:" "} (probably with an unprintable character that stops the browser from interpreting the file).

On Tue, Jun 12, 2012 at 2:40 PM, Matt Wrock < reply@reply.github.com

wrote:

Sorry for the delay here. Reverse the order that the two modules are declared in your web.config putting the RequestReduce module first. The ext directrequestmodule is somehow manipulating the response in such a way that causes RequestReduce not to see the css.


Reply to this email directly or view it on GitHub: https://github.com/mwrock/RequestReduce/issues/185#issuecomment-6269252

itotm commented 12 years ago

I searched better, that line is in a standard "reset" css http://www.w3.org/TR/CSS21/sample.html. The \A is simply a new line, I think the minificator parser translates it into a real new line character, breaking the css.

On Mon, Jun 18, 2012 at 4:21 PM, Fabrizio Ferrari <ito.the.machine@gmail.com

wrote:

Hi, thanks for your support. Putting the module first works, but something strange happens to the css. It seems that the browser does not read the file entirely, but only in part. I updated the example to show the behaviour: http://dl.dropbox.com/u/9262727/RR-ExtNet-Test.zip

I think the problem is this line .x-panel-reset .x-panel-body br:before { content: "\A" }

that in the minified css becomes .x-panel-reset .x-panel-body br:before{content:" "} (probably with an unprintable character that stops the browser from interpreting the file).

On Tue, Jun 12, 2012 at 2:40 PM, Matt Wrock < reply@reply.github.com

wrote:

Sorry for the delay here. Reverse the order that the two modules are declared in your web.config putting the RequestReduce module first. The ext directrequestmodule is somehow manipulating the response in such a way that causes RequestReduce not to see the css.


Reply to this email directly or view it on GitHub: https://github.com/mwrock/RequestReduce/issues/185#issuecomment-6269252

mwrock commented 12 years ago

Thanks for this info. I just confirmed that this is an issue with the MS Ajax Minifier used by requestReduce. I have opened a bug with that project here: http://ajaxmin.codeplex.com/workitem/18279

mwrock commented 12 years ago

I pulled in their fix. Its in source now and I will deploy it soon.