Skip to content

Feature/estab caching - #479

Merged
DMurf merged 21 commits into
mainfrom
feature/estab-caching
Aug 19, 2026
Merged

Feature/estab caching#479
DMurf merged 21 commits into
mainfrom
feature/estab-caching

Conversation

@DMurf

@DMurf DMurf commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR creates a lightweight cached Establishment entity, so that all checks for basic information (Is Phase type, DfE Analytics, show establishment name, get LA id etc) are all read from cache, drastically cutting down the number of requests to the establishment database.

This change also includes the introduction of a Development-only Profiling view. To help figure out what is going on "under-the-hood"

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

All existing tests have been updated and pass.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@DMurf DMurf added the deploy A Review App will be created for PRs with this label label Aug 18, 2026
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

Review app for PR 479 was deleted

@DMurf
DMurf marked this pull request as ready for review August 19, 2026 08:49
stuw-dfe
stuw-dfe previously approved these changes Aug 19, 2026
@github-actions

Copy link
Copy Markdown

Summary

Summary
Generated on: 08/19/2026 - 14:27:55
Parser: Cobertura
Assemblies: 4
Classes: 173
Files: 170
Line coverage: 81.3% (3690 of 4534)
Covered lines: 3690
Uncovered lines: 844
Coverable lines: 4534
Total lines: 11571
Branch coverage: 68.1% (446 of 654)
Covered branches: 446
Total branches: 654
Method coverage: Feature is only available for sponsors

Coverage

SAPData - 75.7%
Name Line Branch
SAPData 75.7% 63.4%
SAPData.Filters.SqlViewFilterProvider 100% 100%
SAPData.GenerateIndexes 100% 100%
SAPData.GenerateRawTables 58.6% 39%
SAPData.GenerateViews 81.4% 75.9%
SAPData.KeyStageConstants 100%
SAPData.Models.DataMapMapping 0%
SAPPub.Core - 87.6%
Name Line Branch
SAPPub.Core 87.6% 87.5%
SAPPub.Core.ApplicationServices.EntityPropertyService 0% 0%
SAPPub.Core.Attributes.DbColumnNameAttribute 0%
SAPPub.Core.Enums.Progress8BandingExtensions 100% 100%
SAPPub.Core.Exceptions.NotFoundException 100%
SAPPub.Core.Extensions.DoubleExtensions 100%
SAPPub.Core.Extensions.EducationPhaseFormatter 100% 100%
SAPPub.Core.Extensions.EstablishmentExtensions 100%
SAPPub.Core.Extensions.EstablishmentStatusExtensions 94.7% 100%
SAPPub.Core.Extensions.SchoolSearchDocumentExtensions 100%
SAPPub.Core.Extensions.StringExtensions 100% 100%
SAPPub.Core.Helpers.AcademicYearsHelper 100%
SAPPub.Core.Helpers.MappingHelper 88.8% 100%
SAPPub.Core.Helpers.TextHelpers 86.6% 100%
SAPPub.Core.ServiceModels.Common.Pager 75%
SAPPub.Core.ServiceModels.EstablishmentMinimumServiceModel 100%
SAPPub.Core.ServiceModels.EstablishmentServiceModel 100%
SAPPub.Core.ServiceModels.KS4.Performance.AdditionalMeasuresModel 100%
SAPPub.Core.ServiceModels.Search.InputModels.SearchQuery 100%
SAPPub.Core.Services.DestinationsService 100%
SAPPub.Core.Services.EmailService 100% 100%
SAPPub.Core.Services.EstablishmentService 100%
SAPPub.Core.Services.Gateway.GatewayLocalAuthorityService 0%
SAPPub.Core.Services.Gateway.GatewaySettingsService 0%
SAPPub.Core.Services.Gateway.GatewayUserAuditService 0%
SAPPub.Core.Services.Gateway.GatewayUserLAService 0%
SAPPub.Core.Services.Gateway.GatewayUserService 0%
SAPPub.Core.Services.KS4.Absence.EnglandAbsenceService 100%
SAPPub.Core.Services.KS4.Absence.EstablishmentAbsenceService 100%
SAPPub.Core.Services.KS4.Absence.LAAbsenceService 100%
SAPPub.Core.Services.KS4.Attendance.AttendanceService 100% 100%
SAPPub.Core.Services.KS4.Performance.EnglandPerformanceService 100%
SAPPub.Core.Services.KS4.Performance.EnglishAndMathsResultsService 100%
SAPPub.Core.Services.KS4.Performance.EstablishmentPerformanceService 100%
SAPPub.Core.Services.KS4.Performance.LAPerformanceService 100%
SAPPub.Core.Services.MySchoolsListService 95.2% 100%
SAPPub.Core.Services.Performance.KS2MeetingOrExceedingStandardsService 100%
SAPPub.Core.Services.Performance.KS2ScaledScoresService 100%
SAPPub.Core.Services.Performance.KS4EstablishmentSubjectEntriesService 100% 100%
SAPPub.Core.Services.Performance.KS5EstablishmentSubjectEntriesService 100%
SAPPub.Core.Services.Performance.Level2QualificationsService 85.1%
SAPPub.Core.Services.Performance.Level3QualificationsService 100% 100%
SAPPub.Core.Services.Search.FeatureFlagSearchVisibilityPolicy 0%
SAPPub.Core.Specifications.SearchVisibilitySpecification 100% 100%
SAPPub.Core.ValueObjects.CodedDouble 100%
SAPPub.Core.ValueObjects.CodedString 100%
SAPPub.Infrastructure - 58.4%
Name Line Branch
SAPPub.Infrastructure 58.4% 22.9%
SAPPub.Infrastructure.Mapping.ValueCodes.CodedDoubleTypeHandler 9% 0%
SAPPub.Infrastructure.Mapping.ValueCodes.CodedStringTypeHandler 10% 0%
SAPPub.Infrastructure.Mapping.ValueCodes.ReasonCodeLookup 50%
SAPPub.Infrastructure.Mapping.ValueCodes.ReflectionCodedValueMapper 0% 0%
SAPPub.Infrastructure.Mapping.ValueCodes.ValueCodeParser 0% 0%
SAPPub.Infrastructure.PostcodeLookup.PostcodeLookupService 100%
SAPPub.Infrastructure.PostgresSearch.PostgresSchoolSearchIndexReader 100%
SAPPub.Infrastructure.Repositories.Destinations.KS4DestinationsRepository 0%
SAPPub.Infrastructure.Repositories.EmailRepository 94.1%
SAPPub.Infrastructure.Repositories.EstablishmentRepository 100% 100%
SAPPub.Infrastructure.Repositories.Gateway.GatewayLocalAuthorityRepository 100% 100%
SAPPub.Infrastructure.Repositories.Gateway.GatewayUserAuditRepository 100%
SAPPub.Infrastructure.Repositories.Gateway.GatewayUserRepository 100%
SAPPub.Infrastructure.Repositories.Generic.DapperCommandBuilder 0% 0%
SAPPub.Infrastructure.Repositories.Generic.DapperRepository`1 100% 100%
SAPPub.Infrastructure.Repositories.Generic.JSONRepository`1 0% 0%
SAPPub.Infrastructure.Repositories.Helpers.DapperHelpers 65.5% 0%
SAPPub.Infrastructure.Repositories.KS4.Absence.EnglandAbsenceRepository 100%
SAPPub.Infrastructure.Repositories.KS4.Absence.EstablishmentAbsenceReposito
ry
100%
SAPPub.Infrastructure.Repositories.KS4.Absence.LAAbsenceRepository 100%
SAPPub.Infrastructure.Repositories.KS4.Performance.EnglandPerformanceReposi
tory
100%
SAPPub.Infrastructure.Repositories.KS4.Performance.EstablishmentPerformance
Repository
100%
SAPPub.Infrastructure.Repositories.KS4.Performance.LAPerformanceRepository 100%
SAPPub.Infrastructure.Repositories.LaUrlsRepository 100%
SAPPub.Infrastructure.Repositories.Performance.KS2PerformanceRepository 100%
SAPPub.Infrastructure.Repositories.Performance.KS4EstablishmentSubjectEntri
esRepository
100%
SAPPub.Infrastructure.Repositories.Performance.KS5EstablishmentSubjectEntri
esRepository
100%
SAPPub.Infrastructure.Repositories.Performance.KS5PerformanceRepository 100%
SAPPub.Web - 88.7%
Name Line Branch
SAPPub.Web 88.7% 82.2%
SAPPub.Web.Areas.Compare.Controllers.SecondaryController 100%
SAPPub.Web.Areas.Compare.Filters.SecondaryComparisonQueryValidationAttribut
e
0%
SAPPub.Web.Areas.Compare.ViewModels.Secondary.CompareAboutYourSchoolsViewMo
del
100%
SAPPub.Web.Areas.Compare.ViewModels.Secondary.CompareAcademicPerformanceEng
lishAndMathsResultsViewModel
100%
SAPPub.Web.Areas.Compare.ViewModels.Secondary.CompareAcademicPerformancePup
ilAttainmentViewModel
100% 100%
SAPPub.Web.Areas.Compare.ViewModels.Secondary.CompareDestinationsViewModel 100% 100%
SAPPub.Web.Areas.Compare.ViewModels.Secondary.CompareNextStepsViewModel 100%
SAPPub.Web.Areas.Compare.ViewModels.Secondary.CompareSecondarySchoolBaseVie
wModel
100%
SAPPub.Web.Areas.Compare.ViewModels.Secondary.SchoolAttainmentDetailsViewMo
del
100% 100%
SAPPub.Web.Areas.Gateway.Controllers.GatewayController 53% 50%
SAPPub.Web.Areas.Profiles.Controllers.AboutController 100%
SAPPub.Web.Areas.Profiles.Controllers.AdmissionsController 100%
SAPPub.Web.Areas.Profiles.Controllers.CurriculumController 100%
SAPPub.Web.Areas.Profiles.Controllers.DestinationsController 100%
SAPPub.Web.Areas.Profiles.Controllers.KS2Controller 100%
SAPPub.Web.Areas.Profiles.Controllers.KS4Controller 100%
SAPPub.Web.Areas.Profiles.Controllers.KS5Controller 52.6%
SAPPub.Web.Areas.Profiles.Filters.DfEAnalyticsAddPhaseTagFilter 0%
SAPPub.Web.Areas.Profiles.Filters.PrimaryQueryValidationFilter 0%
SAPPub.Web.Areas.Profiles.Helpers.AcademicYearSelectionExtensions 94.4% 100%
SAPPub.Web.Areas.Profiles.Helpers.GcseGradeSelectionExtensions 64.2% 50%
SAPPub.Web.Areas.Profiles.ViewModels.AboutSchool.AboutSchoolViewModel 100% 100%
SAPPub.Web.Areas.Profiles.ViewModels.Admissions.AdmissionsViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.Attendance.AttendanceViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.Destinations.KS4DestinationsViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.Destinations.KS5DestinationsViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.KS2.AcademicPerformanceAdditionalMeasu
resViewModel
100%
SAPPub.Web.Areas.Profiles.ViewModels.KS2.AcademicPerformanceMeetingOrExceed
ingStandardsViewModel
100%
SAPPub.Web.Areas.Profiles.ViewModels.KS2.AcademicPerformancePupilProgressVi
ewModel
100%
SAPPub.Web.Areas.Profiles.ViewModels.KS2.AcademicPerformanceSubjectScaledSc
oresViewModel
100%
SAPPub.Web.Areas.Profiles.ViewModels.KS2.CurriculumAndExtraCurricularActivi
tiesViewModel
100%
SAPPub.Web.Areas.Profiles.ViewModels.KS4.AcademicPerformanceAttainmentAndPr
ogressViewModel
100%
SAPPub.Web.Areas.Profiles.ViewModels.KS4.AcademicPerformanceSubjectsEntered
ViewModel
100%
SAPPub.Web.Areas.Profiles.ViewModels.KS4.CurriculumAndExtraCurricularActivi
tiesViewModel
100%
SAPPub.Web.Areas.Profiles.ViewModels.KS5.AdditionalDataViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.KS5.AverageResultViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.KS5.EnglishMathsQualificationsViewMode
l
100%
SAPPub.Web.Areas.Profiles.ViewModels.KS5.EnglishMathsScoreViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.KS5.Ks5SubjectEnteredViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.KS5.KS5ViewModel 0%
SAPPub.Web.Areas.Profiles.ViewModels.KS5.Level2QualificationViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.KS5.Level3QualificationViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.KS5.ProgressScoreViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.ProfileBaseViewModel 100% 100%
SAPPub.Web.Areas.Profiles.ViewModels.SimpleCodedDoubleTableViewModel 100%
SAPPub.Web.Areas.Profiles.ViewModels.SubjectsEnteredBaseModel 66.6%
SAPPub.Web.Constants.Constants 100%
SAPPub.Web.Controllers.CookiesController 90.4% 100%
SAPPub.Web.Controllers.ErrorController 82.3% 100%
SAPPub.Web.Controllers.HealthController 67.5% 100%
SAPPub.Web.Controllers.HelpController 100%
SAPPub.Web.Controllers.HomeController 100%
SAPPub.Web.Controllers.MySchoolsController 100% 100%
SAPPub.Web.Controllers.MySchoolsListController 100% 100%
SAPPub.Web.Controllers.SchoolController 0%
SAPPub.Web.Controllers.SearchController 100% 100%
SAPPub.Web.Extensions.HttpContextExtensions 0% 0%
SAPPub.Web.Helpers.AttainmentHelper 98.3% 100%
SAPPub.Web.Helpers.CommonHelper 100% 100%
SAPPub.Web.Helpers.DisplayField`1 67.6% 50%
SAPPub.Web.Helpers.DisplayFieldExtensions 100% 100%
SAPPub.Web.Helpers.EnumHelper 100%
SAPPub.Web.Helpers.ProgressBandingHelper 77.7%
SAPPub.Web.Helpers.TempDataHelper 100% 100%
SAPPub.Web.Helpers.UrlHelper 100% 100%
SAPPub.Web.Middleware.DependenciesExtensions 100% 100%
SAPPub.Web.Middleware.GatewayMiddleware 100% 100%
SAPPub.Web.Middleware.GatewayMiddlewareExtensions 0%
SAPPub.Web.Middleware.MyMemoryCache 0%
SAPPub.Web.Middleware.NotFoundExceptionHandler 50% 50%
SAPPub.Web.Middleware.SecurityHeadersMiddleware 89.1%
SAPPub.Web.Middleware.SecurityHeadersMiddlewareExtensions 100%
SAPPub.Web.Models.BaseViewModel 87.5% 100%
SAPPub.Web.Models.Common.PagerViewModel 62% 100%
SAPPub.Web.Models.Common.PaginationItem 85.7%
SAPPub.Web.Models.ErrorViewModel 0%
SAPPub.Web.Models.MySchools.MySchoolModel 100%
SAPPub.Web.Models.MySchools.MySchoolsListViewModel 100%
SAPPub.Web.Models.MySchools.RemoveSchoolViewModel 100%
SAPPub.Web.Models.Search.SearchResult 100% 100%
SAPPub.Web.Models.Search.SearchResultsViewModel 100% 100%
SAPPub.Web.Models.SecondarySchool.AcademicPerformanceAdditionalMeasuresView
Model
100%
SAPPub.Web.Models.SecondarySchool.AcademicPerformanceEnglishAndMathsResults
ViewModel
100%
SAPPub.Web.Models.SecondarySchool.SuccessorOrPredecessorDetailsModel 100%
SAPPub.Web.ViewComponents.Banner.Banner 100%
SAPPub.Web.ViewComponents.ChartWithTableToggle.ChartWithTableToggle 100%
SAPPub.Web.ViewComponents.MySchools.AddSchoolButton 100%
SAPPub.Web.ViewComponents.Pagination.Pagination 100%
SAPPub.Web.ViewComponents.VerticalNavigation.VerticalNavigation 100%
SAPPub.Web.ViewComponents.VerticalNavigation.VerticalNavigationModel 50% 0%
SAPPub.Web.ViewComponents.VerticalNavigationCompareSecondary.VerticalNaviga
tionCompareSecondary
100%
SAPPub.Web.ViewComponents.VerticalNavigationCompareSecondary.VerticalNaviga
tionCompareSecondaryModel
0% 0%
SAPPub.Web.ViewComponents.VerticalNavigationMySchools.VerticalNavigationMyS
chools
100%
SAPSec.Web.Setup.WebApplicationBuilderExtensions 33.8% 12.5%

@github-actions

Copy link
Copy Markdown

No critical or severe accessibility issues found

@DMurf
DMurf merged commit 0b3f83c into main Aug 19, 2026
11 checks passed
@DMurf
DMurf deleted the feature/estab-caching branch August 19, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deploy A Review App will be created for PRs with this label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants