Public caching causes an issue with cache validation on browser causing images not to be cached correctly. Made private to ensure we get proper images each load.

This commit is contained in:
Joseph Milazzo 2021-03-12 18:35:12 -06:00
parent 1f24725905
commit 52b91a9b92
4 changed files with 4 additions and 10 deletions

View File

@ -228,11 +228,6 @@ namespace API.Controllers
[HttpGet("search")]
public async Task<ActionResult<IEnumerable<SearchResultDto>>> Search(string queryString)
{
// TODO: Add indecies to DB for the searched fields
//NOTE: What about normalizing search query and only searching against normalizedname in Series?
// So One Punch would match One-Punch
// This also means less indexes we need.
// TODO: Add indexes of what we are searching on
queryString = queryString.Replace(@"%", "");
var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(User.GetUsername());

View File

@ -6,7 +6,6 @@
public string Name { get; init; }
public string OriginalName { get; init; }
public string SortName { get; init; }
//public byte[] CoverImage { get; init; } // This should be optional or a thumbImage (much smaller) // TODO: Refactor to lazy loading
// Grouping information
public string LibraryName { get; set; }

View File

@ -422,7 +422,7 @@ namespace API.Parser
public static string Normalize(string name)
{
return name.ToLower().Replace("-", "").Replace(" ", "");
return name.ToLower().Replace("-", "").Replace(" ", "").Replace(":", "");
}

View File

@ -105,11 +105,11 @@ namespace API
context.Response.GetTypedHeaders().CacheControl =
new Microsoft.Net.Http.Headers.CacheControlHeaderValue()
{
Public = true,
Public = false,
MaxAge = TimeSpan.FromSeconds(10)
};
// context.Response.Headers[Microsoft.Net.Http.Headers.HeaderNames.Vary] =
// new string[] { "Accept-Encoding" };
context.Response.Headers[Microsoft.Net.Http.Headers.HeaderNames.Vary] =
new string[] { "Accept-Encoding" };
await next();
});