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

WinIO error while trying to reduce files #143

Closed dasmod closed 12 years ago

dasmod commented 12 years ago

I am trying to use RequestReduce on a Turkish system. my path is: d:\x\src\WebUI\requestreducecontent

Request Reduce throws the following error while trying to reduce the files: (It is because of the "I" character - Turkish has an "ı" character as well as an "i" character and because of that WebUI lowers to webuı instead of webui. It will work if "I" lowers to "i" instead of "ı")

Exception #1: There were errors reducing http://localhost/x/yj.s::
Exception #2: Could not find a part of the path 'd:\x\src\webuı\requestreducecontent\7f9a217c753202413dfda4217aff3b6f-443d7e47b352db183211852f21930fe1-requestreducedscript.js'.
Stack Trace#2:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights,  FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
at RequestReduce.Utilities.FileWrapper.Save(Byte[] content, String fileName) in c:\RequestReduce\RequestReduce\Utilities\FileWrapper.cs:line 17
at RequestReduce.Store.LocalDiskStore.Save(Byte[] content, String url, String originalUrls) in c:\RequestReduce\RequestReduce\Store\LocalDiskStore.cs:line 80
at RequestReduce.Reducer.HeadResourceReducerBase`1.Process(Guid key, String urls) in c:\RequestReduce\RequestReduce\Reducer\HeadResourceReducerBase.cs:line 43
at RequestReduce.Module.ReducingQueue.ProcessQueuedItem() in c:\RequestReduce\RequestReduce\Module\ReducingQueue.cs:line 162
dasmod commented 12 years ago

I used "spritePhysicalPath" in order to get around the issue.

mwrock commented 12 years ago

Hey that's fascinating. Learned something new today and in honor of Turkish users I will forego the dotting of my lower case I's for today.

I've made several changes throughout the code to specify invariantculture where this can be problematic. Glad spritePhysicalPath got you around this but I would get the latest v 1.7.103 to avoid other potentially turkish unfriendly scenarios.

Please let me know if you encounter any other problems and thanks for reporting this!

dasmod commented 12 years ago

Thanks for the quick reply and changes! :)

I will test and let you know how v 1.7.103 works on my system.

dasmod commented 12 years ago

OK, tested it and it works. Thanks!

Now I have to do something to solve the local mock SSL certificate problem to get requestreduce work on https development environment.