Shinkansen, My New Project, Is Up On CodePlex
Posted in Development
A couple of days ago I launched my latest project, Shinkansen, on CodePlex (overview and documentation).
Overview
In a nutshell, Shinkansen is a sever control + HTTP handler combo which allows you declare your JavaScript and CSS includes like you normally would, and have them:
- HTTP compressed
- Crunched (minified and so on)
- Combined into a single download
- Cached on the client
Most of these tasks you can perform on your own.
For example, you can configure HTTP compression in IIS. However, it's possible only if you have physical access to a web server and are allowed to edit the metabase (IIS6) or tweak IIS settings (IIS7) by hand.
You can minify JavaScript as a step of a build process, but how do you combine scripts, and how do you set cache expiration headers?
Having dealt with these disparate tasks before, I wanted to build a component to streamline it all.
Resources
As I mention in Resources, two books in particular were of great inspiration: High Performance Web Sites and Even Faster Web Sites. Much of the ideas from these books have been incorporated into the project.
Also, two Firefox add-ons were of great help: Google's Page Speed and Yahoo's YSlow.
Feedback
Feel free to download binaries or source code and play. I will definitely appreciate suggestions and bug reports.
19 comments
Wayne Brantley
on January 25, 2010
My solution for css that happens at design time and covers the combining, compression and Less integration.
http://blog.waynebrantley.com/2009/12/ultimate-automatic-stylesheet-combining.html
Brian J. Sayatovic
on January 26, 2010
As a recent migrator from Java to .NET, I was missing Jawr (https://jawr.dev.java.net/). This seems to be the .NET equivalent. Thanks!
Milan Negovan
on January 26, 2010
Brian, thank you. This would be a good approach for MVC.
rob
on January 27, 2010
Milan, this is so totally great, I can't wait to use it on my next .NET project (some time next month) ... Probably going to mention this over on my employer's blog (http://blog.navigationarts.com), FYI
Milan Negovan
on January 27, 2010
Thank you, Rob!
Guille
on April 1, 2010
Awesome work Milan, we've been exactly for this. We are trying to use it but we are struggling to make it work, probably something we are doing wrong. I placed the binaries in the /bin folder, modified the web.config file to include all the sections described in the documentation, included the Shinkansen tags in a master page. Looking at the source code of the generated page, I can see that the script tag is included but when I follow the src for that script tag I end up with a 404 HTML page for Shinkansen.axd. Any ideas ?
Milan Negovan
on April 1, 2010
Guille, are you running your project as a separate site in IIS or from a virtual folder?
Guille
on April 1, 2010
Hi Milan, I was runnung as a virtual folder, but I managed to make it work, the problem is always between the keyboard and the chair :-)
Milan Negovan
on April 1, 2010
Guille, if you'd like to share the solution, I'll be happy to know in case other folks run into 404s.
Guille
on April 2, 2010
I am using IIS7, therefore I included the
Mohit Thakral
on April 28, 2010
Hi Milan,
Have you considered ETAG and images inside css. Because, I was not able to see ETAG in FIREBUG, and my css images were not showing up as well. what about setting some base url. To which request would be made, or something of that sort.
Regards
Mohit
Milan Negovan
on April 28, 2010
Mohit,
I've excluded ETag because this header is more trouble than it's worth. There's a good discussion about the issue in "High Performance Web Sites" by Steve Souders.
As to images in CSS, there isn't much you can do. You hardcode a URL by hand so Shinkansen can't get to it.
Mohit Thakral
on April 28, 2010
Thanks for Reply Milan,
I think cssimage path can be resolved by following bug fix.
http://shinkansen.codeplex.com/WorkItem/View.aspx?WorkItemId=3929
One more thing i found is that if i m trying to deliver let us say 30+ css files. It give me a 404 error.
Can you please look into that as well.
Regards
Milan Negovan
on April 28, 2010
Thirty files---that is interesting. What happens sometimes is a minifier blows up because it can't parse something. It occurs very rarely, but when it does I try to let the developers know.
Do you think you could send me something? Perhaps a sample project with a test page and those CSS files, if your employer/client has no objections? It would be extremely helpful.
Mohit Thakral
on April 28, 2010
It is pretty simple actually. I am trying to deliver Telerik rad control theme. So, do you want me to mail the zip file to "milan@aspnetresources.com" mail addresss. I will create a sample Project and send it to you
Milan Negovan
on April 28, 2010
Mohit,
Sure, please send it to me.
Mohit Thakral
on April 29, 2010
I think 30 files is not issue. There must be something else going wrong.
Do you know what was the fix for following issue. Did it ever made to trunk.
http://shinkansen.codeplex.com/WorkItem/View.aspx?WorkItemId=3929
PathToAxd is also private.
Milan Negovan
on May 2, 2010
Yes, the fix was implemented a while ago.

Steven
on January 25, 2010
This sounds very promising. Good job!