How to find if a request is for js or css in httpHandler


Tags: css,compression,request,ihttphandler,jscompress

Problem :

is there any way to find if a particular request is for JS or CSS in httphandler

to improve the performance of my website i was using HttpCompress from Code Project http://www.codeproject.com/KB/aspnet/httpcompression.aspx?msg=2544100

but since it is combining all the js it is breaking my javascript in many places...so i want to write a httphandler so that iwould be able to serve the js and css compressed.( i have already minified them using YUICompressor). i know this will cause multiple http request but in my case i have a deadline and so dont want combining of javascripts and css.

so any approach to do so???????

also i have seen in the source codes of compression module that they check if the file is already on the browser and send a 304 Not Modified response header but it is a little confusing to me so can anyone break it down as to how to proceed if i want to do the same....

i do not want whole answer just simple pointers would do...

thanks a lot

P.S i am on shared hosting and do not have access to IIS



Solution :

In the example config file for HttpCompress they give two options for excluding files from being compressed: Exclusion by MIME type and Exclusion by path.

The following config file presumes that your server is serving javascript as text/javascript (something you should double check before setting).

<DCWeb>
<HttpCompress  compressionType="GZip">

  <IncludedMimeTypes>
    <add mime="text/html" />
  </IncludedMimeTypes>


  <ExcludedMimeTypes>
    <add mime="text/javascript" />
  </ExcludedMimeTypes>

   <ExcludedPaths>
     <add path="~/PathToYourJavascriptFiles/" />
   </ExcludedPaths>

  </HttpCompress>
 </DCWeb>

    CSS Howto..

    How to use css in one page only?

    How to exclude specific the form from the css applied to body [duplicate]

    How to keep css animation effect?

    How to Remove the White Space below the Footer in Wordpress Site using CSS

    How to align image within nested div<> with spaces in div names

    hovering over list item, only one item showing up instead of all

    How to make CSS animation not reverse after finishing? Example inside

    How to keep css id to the 'li' in css

    a[title] not showing expected result [closed]

    How to change both fill and stroke in svg with css

    How to remove a CSS style on the fly

    How to apply texture to text with a shadow

    How can I ensure this CSS transition animates

    how to add same width on bootstrap dropdown menu item as parent item

    How to add a color in the
    bottom content area?

    How to get rid of background when something is clicked

    How to get a different link color on my tumblr static page then my main (front page?)

    How to prepend a number before an HTML H2 with CSS?

    How do i style a list within a list?

    How to add border between td's in which are in different tr's?

    How do I link to top of a section on the page minus the height of a fixed nav-bar?

    How do I put these on the same line?

    How to transform a production to LL(1) for a list separated by a semicolon?

    How to use horizontal scroll when you have way many columns

    How do I create a CSS class Union?

    how to access image through div

    How to wrap UL list - LIs on new line with css

    CSS - how to keep images within container during browser window resize?

    How use a -ms-expand in GWT (Google Web Tolkit)

    How to keep width of the main container to maximum width in a 3 column fluid layout?