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 48 forks source link

I had a strange issue when using jQuery.load. This fixed it locally. #124

Closed bizzarry closed 12 years ago

bizzarry commented 12 years ago

Hey guys, Awesome project!!!

Without going into too much of the 'why'...

I am loading content via jQuery.load. Within this content (not in a tag because it's only partial content), there are script tags. RequestReduce combines them into one file like I would expect. However jQuery seems to by modifying the http request url and adding "?_=1327618241109" to any content that is loaded via .load. (note, it doesn't not add it to my partial content request, it adds it to the script GET request) I only added code to remove everything after the first '?' character....perhaps any illegal characters should be removed?

Here is where I learned a bit about the strange underscore character: http://stackoverflow.com/questions/3687729/who-add-single-underscore-query-parameter

The script tag looks like this:

Yet the request from the browser (I've also double checked Fiddler) looks like this: http://localhost/RequestReduceContent/610d2c2aa901bcf1bbdc2ca173be017b-91020c5cf86c4891c372ae53473cfc12-RequestReducedScript.js?_=1327690666263

Other options I had were to use jQuery's getScript, but then RequestReduce doesn't run on the script. I could have also used "RRFilter" but again, then I can't take advantage of RequestReduce.

Regards, Chris

mwrock commented 12 years ago

This is now released. I moved your fix to a different location so that any IStore implementation will benefit. Thanks for the submitting this!

bizzarry commented 12 years ago

Awesome! Thanks!