Website, Central government
esfondi.lv, from a five-second wait to instant loading
esfondi.lv is the Ministry of Finance's portal on EU funds, with thousands of visits a day and hundreds of users across Latvian ministries. When we took over its new version from another developer in April 2023, pages took about 5 seconds to load. We found the causes in the existing Statamic and Laravel system, and pages now load instantly, even without a cache.
- Client
- Ministry of Finance of the Republic of Latvia
- Sector
- Central government
- Period
- since 2020
- Services
- Website takeoverDebugging and diagnosticsServer and performance optimisationOpen data integrationMaintenance
- Platform
- StatamicLaravelRedisMariaDBMSSQL
- Link
- esfondi.lv
01, Chapter
Finding the cause
Slowness was not the only problem. The portal was returning server errors together with page-not-found errors, content editors could not upload documents, and a large number of errors had built up in the application log.
The portal is built on Statamic Pro, a content management system based on Laravel. Its ten custom add-ons cover features such as sign-in through the national authentication service, news, events and data on implemented projects. Development, testing and production run in separate environments. We had already maintained the portal for the ministry in 2020 and 2021.
First we built a test environment from the repository and reproduced the problems there, so nothing in production changed until the cause was clear. Analysing the server and application logs and debugging Statamic showed that there were several causes.
On every page, navigation trees were loaded with all their fields and the sidebar menu was rebuilt from scratch. Statamic's content watcher kept polling the content folder, and the cache was not centralised. The biggest finding was the static cache. Pre-built pages already existed, but the web server did not serve them directly, so every request still started PHP and Laravel. The log showed this thousands of times a day.
From these findings we drew up a change plan and carried it out in stages, testing each stage in the test environment before release.
02, Chapter
How we made it fast
We switched off Statamic's content watcher, turned on cache tags and moved both the cache and the sessions to Redis. Navigation now reads only each page's title and URL. We split the sidebar in two. The structure, which is the same on every page, is cached, while a small script marks the active page in the browser.
We introduced full static caching, where pages are stored as ready-made HTML files. The news and events blocks, which change often, stay dynamic. Invalidation rules cover 13 content collections. When an editor saves an entry, only that entry's page, its listing and the affected filter pages are cleared from the cache. A Redis queue rebuilds changed pages in the background, so visitors always get a ready-made page.
Every night at midnight an automated job imports project data, clears the cache and rebuilds about 10,000 pages. To keep forms working on static pages, we added a small endpoint that issues a fresh security token.
03, Chapter
Open data and API
In December 2024 we rebuilt the implemented projects section and connected it to open data. EU funds and Recovery Fund projects are imported from the national open data portal. The import refreshes Recovery Fund data daily and the rest weekly, and it skips unchanged rows. For faster synchronisation there is also a direct link to the MSSQL database of the EU funds information system.
The portal's filters for projects, available support and contacts use a public API, which we extended with search for the demarcation matrix.
04, Chapter
The demarcation matrix
The demarcation matrix shows which EU fund and which institution is responsible for each support measure, so that funding does not overlap. We designed it for desktop and phone in February 2024, and the section was ready in March. Users can choose the programming period, apply filters and search with cached results, and the data is loaded from an Excel file. In January 2025 we trained ministry staff to use it.
Between 2023 and 2025 we also built the portal's Recovery Fund section, the Monitoring Committee e-portfolio, the project calls section and the call questionnaire.
05, Chapter
Long-term maintenance
We prepared the Statamic upgrade from 3.3 to 3.4 in February 2024 and carried it out in production that December, fixing and testing every custom add-on. We install security fixes regularly. In 2024 we diagnosed server problems and restored the site and its search, and in 2025 we cleared old logs from the server disk so the errors would not return.
06, Video
The portal in motion
07, Chapter
The result
The portal loads instantly, editors find it easier to work in, and project data updates automatically every night. No rebuild was needed. It was enough to find and fix the causes of the slowness on the existing platform.
- Page loads cut from about 5 seconds to instant, even without a cache.
- A static cache with targeted invalidation, and about 10,000 pages rebuilt every night.
- Faster, smoother work for visitors and for hundreds of users across ministries.
- A Statamic upgrade, open data integration and the demarcation matrix.
Related services: Website takeover and maintenance, Business systems development. A similar project: SPKC website maintenance.
The service was provided on time and to a high standard. During the maintenance period, technical shortcomings were remedied, improvements were made, new functionality was implemented and existing modules were developed further.
Is a slow website holding you back?
Send us your site's address and tell us where it slows you down most. We'll find the cause and tell you what can be fixed in your current system before you decide on a rebuild.
Speed up your website






