Skip to content

Conversation

@joecklau
Copy link

Add support on fetching Uri with local filepath like "file:///C:/website/style.css"

It's required when we optimize the performance by fetching the local resource internally instead of making external web request towards internal resource.
e.g. As I know the css is actually inside the local storage, it make sense to just make a fast local fetch ("file:///C:/website/style.css") instead of external web request ("https://www.mysite.com/style.css")

So I can now initialize a PreMailer instance with BaseUri "file:///" + new Uri(System.Web.Hosting.HostingEnvironment.MapPath("~/"), UriKind.Absolute)

It's how I boost the performance for my client, just share my code here.

@martinnormark martinnormark merged commit b88183f into milkshakesoftware:master Sep 15, 2019
@martinnormark
Copy link
Contributor

Thanks for this! Great improvement. 💪

@martinnormark
Copy link
Contributor

Released to Nu Get now, will take a while to process the package and make it available.

@CaptainStack
Copy link

Wow - just installed PreMailer last Thursday and was super frustrated with the lack of support for this. Fantastic timing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants