lazy load scripts

This commit is contained in:
Luke Pulverenti 2015-05-22 15:16:14 -04:00
parent ae768735aa
commit c7171177b9
5 changed files with 26 additions and 14 deletions

View file

@ -625,6 +625,8 @@ namespace MediaBrowser.Api.Images
var file = await _imageProcessor.ProcessImage(options).ConfigureAwait(false);
headers["Vary"] = "Accept";
return ResultFactory.GetStaticFileResult(Request, new StaticFileResultOptions
{
CacheDuration = cacheDuration,

View file

@ -483,6 +483,7 @@ namespace MediaBrowser.MediaEncoding.Probing
FetchStudios(audio, tags, "organization");
FetchStudios(audio, tags, "ensemble");
FetchStudios(audio, tags, "publisher");
FetchStudios(audio, tags, "label");
// These support mulitple values, but for now we only store the first.
audio.SetProviderId(MetadataProviders.MusicBrainzAlbumArtist, GetMultipleMusicBrainzId(FFProbeHelpers.GetDictionaryValue(tags, "MusicBrainz Album Artist Id")));

View file

@ -45,19 +45,15 @@ namespace MediaBrowser.Server.Implementations.HttpServer
}
}
if (dto is CompressedResult)
{
// Per Google PageSpeed
// This instructs the proxies to cache two versions of the resource: one compressed, and one uncompressed.
// The correct version of the resource is delivered based on the client request header.
// This is a good choice for applications that are singly homed and depend on public proxies for user locality.
res.AddHeader("Vary", "Accept-Encoding");
}
var vary = "Accept-Encoding";
var hasOptions = dto as IHasOptions;
var sharpResponse = res as WebSocketSharpResponse;
if (hasOptions != null)
{
//hasOptions.Options["Server"] = "Mono-HTTPAPI/1.1";
// Content length has to be explicitly set on on HttpListenerResponse or it won't be happy
string contentLength;
@ -79,14 +75,29 @@ namespace MediaBrowser.Server.Implementations.HttpServer
return;
}
var sharpResponse = res as WebSocketSharpResponse;
if (sharpResponse != null)
{
sharpResponse.SendChunked = false;
}
}
}
string hasOptionsVary;
if (hasOptions.Options.TryGetValue("Vary", out hasOptionsVary))
{
vary = hasOptionsVary;
}
hasOptions.Options["Vary"] = vary;
}
//res.KeepAlive = false;
// Per Google PageSpeed
// This instructs the proxies to cache two versions of the resource: one compressed, and one uncompressed.
// The correct version of the resource is delivered based on the client request header.
// This is a good choice for applications that are singly homed and depend on public proxies for user locality.
res.AddHeader("Vary", vary);
}
/// <summary>

View file

@ -590,12 +590,7 @@ namespace MediaBrowser.WebDashboard.Api
"kids.js",
"librarypathmapping.js",
"librarysettings.js",
"livetvchannel.js",
"livetvguide.js",
"livetvnewrecording.js",
"livetvprogram.js",
"livetvrecording.js",
"livetvrecordinglist.js",
"livetvtimer.js",
"livetvseriestimer.js",
"livetvsettings.js",

View file

@ -150,6 +150,9 @@
<Content Include="dashboard-ui\scripts\kids.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\livetvcomponents.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\livetvitems.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>