yodeski / mvc-mini-profiler

Automatically exported from code.google.com/p/mvc-mini-profiler
0 stars 0 forks source link

Could we have a mode where the .js and .css files are served extensionless or with asp.net-like extensions? #60

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Scenario:  Using MVC3/.NET4 on hosted IIS6.  Extensionless URLS work ok, 
because .NET4 fixed that for IIS6, .JS and .CSS urls are served statically by 
IIS.

Problem: The dynamically generated .CSS and .JS files used by Mini-profiler are 
not loaded when running on IIS6, because IIS6 does not pass their requests into 
the managed pipeline.

The suggested remedy for this (on SO) is to add a wildcard entry to IIS  to 
pass these requests to the managed pipeline, so that they end up being served 
by mini-profiler.

There are two problems with this:

* I can't make the change, because I don't have access to the IIS config, 
though I might be able to persuade the hosting provider.

* It completely changes (likely slows-down) the way that .JS and .CSS files are 
served, which is an undesirable side-effect of enabling the profiler.

It's not clear to me what the advantages to mini-prof are of serving these 
files dynamically with extensions that are conventionally used for static 
files.  Is there any reason why they can't be served extensionless, direct off 
ordinary MVC action URLs - they'd then work on any setup which can serve MVC3 
normally.

Original issue reported on code.google.com by prefect_...@indcomp.co.uk on 21 Jul 2011 at 10:33

GoogleCodeExporter commented 9 years ago
(Using latest nuget package on 21 July - 1.6?)

Original comment by prefect_...@indcomp.co.uk on 21 Jul 2011 at 10:34

GoogleCodeExporter commented 9 years ago
ok, well, I fixed this locally, with the side-benefit of only needing to add 
one route to the MVC route table, rather than one-per-file.  Not sure if 
there's any interest in making this change to the main code.  I haven't a clue 
what the relevant Hg magic would be, but if anyone wants the patch they can 
mail me.

Original comment by prefect_...@indcomp.co.uk on 22 Jul 2011 at 8:35

GoogleCodeExporter commented 9 years ago
Im fine with this change

Original comment by sam.saff...@gmail.com on 25 Jul 2011 at 11:04

GoogleCodeExporter commented 9 years ago
I do not object to this at all, its just a massive change - if anyone wants to 
submit a patch it is welcome

Original comment by sam.saff...@gmail.com on 26 Aug 2011 at 3:09

GoogleCodeExporter commented 9 years ago
Sam - I sent you the patches for this on 25th July, and you replied on the 26th 
saying you were very busy but might get to them in the future.  It didn't 
actually turn out to be a very big change to the code.  I'll see if I can make 
this work against the current code.

Original comment by elmcroft on 26 Aug 2011 at 7:58

GoogleCodeExporter commented 9 years ago
I also  have a  patched copy to support this. How did you go do it? I simply 
replaced all of the routes with -css and-js...

Original comment by drew.fre...@gmail.com on 26 Aug 2011 at 7:07

GoogleCodeExporter commented 9 years ago
@drew - pretty much the same, except I used underscores.  I had to replace all 
the dots in the paths, not just the last one.  I also changed it to use one 
route, not one-route-per-file, but that wasn't strictly necessary, though there 
must be some cost per route which is nice to avoid.

Original comment by elmcroft on 26 Aug 2011 at 7:53

GoogleCodeExporter commented 9 years ago
there are 2 things that need to still work though 

1. custom "subdirectory" for the profiler includes, the subdirectory may 
contain dots
2. the file in VS needs to be .js ... otherwise you kill all syntax 
highlighting during dev 

Original comment by sam.saff...@gmail.com on 28 Aug 2011 at 11:43