Implemented Response Cashing

This commit is contained in:
2019-12-21 19:43:19 +01:00
parent 6fb37cbee9
commit 641792b2e3
2 changed files with 6 additions and 0 deletions

View File

@ -36,6 +36,8 @@ namespace H_Plus_Sports
services.AddScoped<IProductRepository, ProductRepository>();
services.AddScoped<ISalespersonRepository, SalespersonRepository>();
services.AddResponseCaching();
services.AddMvc(option => option.EnableEndpointRouting = false)
.SetCompatibilityVersion(CompatibilityVersion.Version_3_0)
.AddNewtonsoftJson(opt => opt.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore);
@ -53,6 +55,8 @@ namespace H_Plus_Sports
app.UseDeveloperExceptionPage();
}
app.UseResponseCaching();
app.UseHttpsRedirection();
app.UseRouting();