Activities of "emouselli"

Project Information: ABP version: 10.3 .NET version: .NET 10 UI framework: Blazor WebAssembly Solution type: Tiered Relevant projects: .Application, .Application.Contracts, .AuthServer, .Blazor, .Core, .DB, .DbMigrator, .Domain, .Domain.Seed, .Domain.Shared, .EntityFrameworkCore .HttpApi, .HttpApi.Host, .HttpApi.Client

Issue: After upgrading our solution to ABP 10, the administrator users faced issues when they tried to change the roles of another use. After 3 days of debugging we discovered that the UpdateRolesAsync function had been changed in ABP 10, as now it checks whether the CurrentUser.IsInRole(AbpRoleConsts.AdminRoleName). The problem came from the const AdminRoleName because our own solution has different role names. The solution we chose is to override the UpdateRolesAsync in order to use our own role name, which worked. We would like to propose that the const is changed to property so that it can be changed through configuration. Here is an example: public static class AbpRoleConsts { private static string _adminRoleName = "admin"; // default public static string AdminRoleName { get => _adminRoleName; set => _adminRoleName = value; } } Thank you in advance

Project Information: ABP version: 8.3.4 .NET version: .NET 8 UI framework: Blazor WebAssembly Solution type: Tiered Relevant projects: .Application, .Application.Contracts, .AuthServer, .Blazor, .Core, .DB, .DbMigrator, .Domain, .Domain.Seed, .Domain.Shared, .EntityFrameworkCore .HttpApi, .HttpApi.Host, .HttpApi.Client,

Goal: I want to enable HTTP response caching for API endpoints in my ABP Blazor application. I followed the ABP documentation and examples for HTTP caching, but the caching behavior is not applied when my controllers are located inside the .HttpApi project.

What I Did: I configured ASP.NET Core Output Caching:

builder.Services.AddOutputCache(options => { options.DefaultExpirationTimeSpan = TimeSpan.FromSeconds(30); options.AddPolicy("Default", builder => builder .Expire(TimeSpan.FromSeconds(120)) .SetVaryByHeader("Authorization")); }); and used
[OutputCache( PolicyName = "Default", VaryByRouteValueNames = new[] { nameof(id) })] and [OutputCache( PolicyName = "Default", VaryByQueryKeys = new[] { nameof(FilterInputDto.Id), nameof(FilterInputDto.SearchText), nameof(FilterInputDto.IsActive), nameof(FilterInputDto.Sorting) })] on my API controllers (as needed).

When the controller is inside .HttpApi, caching does not seem to take effect — no caching headers or stored responses.

When I moved the controller to .Web, I got 401 Unauthorized responses instead.

Tested the endpoint — the caching headers were missing.

Moved the same controller from .HttpApi to the .Web project (without using the generated HTTP proxies) — I get authorization errors when accessing endpoints.

The Problems Case 1 – Controller inside .HttpApi

Response caching is not applied — response headers like Cache-Control are missing.

No apparent caching layer is triggered.

Case 2 – Controller moved to .Web

Requests fail with authorization errors:

401 Unauthorized

Happens even for authenticated users that can access the same API endpoints when the controller was in .HttpApi.

What I Tried

Verified that [Authorize] is correctly applied.

Disabled and re-enabled ABP HTTP proxies.

Tested both from Swagger and browser.

Confirmed that other endpoints’ authorization still works normally.

Question

Is HTTP caching officially supported when controllers are placed in the .HttpApi project of an ABP Blazor solution? If so, what configuration is required for it to work?

Showing 1 to 2 of 2 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 28, 2026, 11:44
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.