Website, Central government

An EU funds portal that now loads instantly

esfondi.lv is the Ministry of Finance's portal on European Union funds, with thousands of visits a day and hundreds of users across Latvian ministries. In April 2023 we took over its new Statamic and Laravel version, built by another developer, when pages took about 5 seconds to load. After debugging and server optimisation, 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
esfondi.lv home page in full
Browser, 1440 × 900, Home page

01, Chapter

What we took over

esfondi.lv runs on Statamic Pro on Laravel with ten custom add-ons, including sign-in through the national single sign-on, news, events and data on implemented projects, and it has separate development, test and production environments. We had already maintained esfondi.lv for the ministry in 2020 and 2021, and in 2023 we took over its new version, built by another developer.

At takeover, pages took about 5 seconds to load, server errors appeared alongside missing pages, content editors could not upload documents, and a large number of errors had built up in the application log.

02, Chapter

Diagnostics

First we built a test environment from the repository and reproduced the problems there, so nothing changed in production before we understood the cause. We analysed the server and application logs, debugged Statamic and found several causes at once.

Navigation trees were loaded with every field on every page, the sidebar menu was rebuilt for each page, Statamic's content watcher kept polling the content folder, and the cache was not centralised. The biggest finding was the static cache. Ready-made 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.

03, Chapter

Optimisation

We switched off Statamic's content watcher, turned on cache tags and moved the cache and sessions to Redis. Navigation now reads only the title and URL, and we split the sidebar into two parts, a cacheable structure that is the same on every page and a small script that marks the active page in the browser.

We introduced full static caching, where pages are stored as ready HTML files. The news and events blocks, which change often, stay dynamic, invalidation rules cover 13 content collections, and saving an entry clears only its page, its listing and the filter pages it affects. A Redis queue rebuilds changed pages in the background, so visitors always get a ready 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.

List of project calls on esfondi.lv
Browser, 1440 × 900

04, Chapter

Updates and 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.

05, Chapter

Open data and API

In December 2024 we rebuilt the implemented projects section with open data integration. EU funds and Recovery Fund projects are imported from the national open data portal, the Recovery Fund data daily and the rest weekly, and unchanged rows are skipped. For faster synchronisation there is also a direct link to the EU funds information system in an MSSQL database.

The portal's filters use a public API for searching projects, support and contacts, and we extended it with search for the demarcation matrix.

Search by support area and funding recipient
Browser, 1440 × 900

06, Chapter

The demarcation matrix and new sections

The demarcation matrix shows which EU fund and which institution is responsible for each support measure, so that funding does not overlap. In February 2024 we designed it for desktop and phone, and by March the section was built. The matrix has a programming period selector, filters, search with cached results and data import from an Excel file, and in January 2025 we trained ministry staff to use it.

Between 2023 and 2025 we also built the Recovery Fund section, the Monitoring Committee e-portfolio, the project calls section and the call questionnaire.

The demarcation matrix with filters and a results table
Browser, 1440 × 900
A demarcation entry with measure details
Browser, 1440 × 900
esfondi.lv on a phone
Phone, 390 × 844
The demarcation matrix with filters on a phone
Phone, 390 × 844

07, Video

The portal in motion

00:00 / 00:00
Fig. 01The home page with search, news and EU funds data

08, Chapter

The result

The portal did not need to be rebuilt. It was enough to find and remove the causes in the existing system.

  • Page load 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.

Is your system slow or unstable?

Describe what is happening and when it started. We will find the cause and tell you what can be fixed in the existing system before you think about a rebuild.

Request a diagnosis
Next project Jauniešu Digitālā vēstniecībaWebsite, Local government, youth work, Design, WordPress development, Interactive map, Accessibility, Security