INTRODUCTION

React modernization, API and cache optimization, and an Elasticsearch upgrade for semantic search

The Hamangiu Legal Library is a digital reading platform designed for legal professionals in Romania. In a previous project, OPTI developed the annotations, bookmarks, document navigation, and usage limit control features.

In 2026, the new challenge was increasing real-world performance: rapid document opening, smooth navigation between PDF pages, accessing the table of contents, and reducing loading times.

OPTI modernized the application for high traffic and smooth operation by refactoring React, adopting Vite, optimizing APIs and resource delivery, improving the PDF viewer, and upgrading Elasticsearch. These interventions delivered immediate performance gains while also preparing the platform for the semantic search and AI phase.


React
Vite
Elasticsearch
Modernizing the Hamangiu Legal Library

CHALLENGES

The digital library did not need to be rebuilt, but rather modernized by rewriting the components that improve the user experience.

  1. Accumulated technical debt
    • The platform was functional, but some components consumed more resources than necessary and had become increasingly difficult to optimize over time.
  2. Complex frontend and excessive re-renders
    • The application contains complex pages featuring filters, lists, book details, authentication, a PDF viewer, and a permissions module. Unnecessary renders had to be reduced and resource-intensive components optimized.
  3. Frequently accessed documents and resources
    • Covers and PDF pages are accessed repeatedly. Images needed to be delivered and cached efficiently, including specific pages requested within very long books.
  4. Search modernization
    • The search engine needed to be upgraded while preparing the architecture for search capabilities based on meaning and relationships between concepts.
Cătălin Chivu
"For a mature application, performance does not come from a single optimization. You have to track the entire path: how many requests the interface makes, how fast the API responds, what gets cached, and how an e-reader can work securely."
Cătălin Chivu, Software Engineer

SOLUTION

The project started with benchmarking. We analyzed frontend-backend requests, endpoints, response times, API response sizes, PDF viewer rendering, and Lighthouse scores.

  1. Technical audit and prioritization

    • Issues were ordered according to their effect on the user. Thus, the team separated optimizations with immediately visible results from high-impact structural interventions.
  2. React frontend modernization

    • Components were refactored, libraries were updated, and flows with sequential calls were reorganized to parallelize requests.
    Lighthouse scores: Performance 80, Accessibility 86, Best Practices 92, SEO 100
    After refactoring, optimizing the JavaScript bundle, and improving static resource delivery, the application reached Lighthouse scores of Performance 80, Accessibility 86, Best Practices 92, and SEO 100.
  3. More efficient APIs and caching

    • APIs were adjusted to return only the data needed for each context, with a reduced payload. Images and other static resources were separated and cached in a dedicated service.
    Developer Tools: images delivered in about 60 ms from the dedicated static files service
    Image loading in about 60 ms from the dedicated static files service, as seen in Developer Tools.
  4. PDF Viewer optimization

    • The new e-reader prioritizes the requested page and adjacent pages. Parallelization and monitoring provide performance and visibility into page loading patterns, duplicate requests, and frequently accessed sections of documents.
    Hamangiu Legal Library: PDF viewer with table of contents, annotations, and quick search
    The Hamangiu Legal Library, including the book's table of contents, annotations, and quick search.
  5. Modernized search

    • The Elasticsearch upgrade included reorganizing existing indices with compatibility for semantic/hybrid search.

This case study shows that the performance of a mature web application comes from optimizing the entire path, from the number of interface requests and API response sizes to caching and PDF page loading, not from a complete rewrite.

ARCHITECTURE

Performance optimization at every layer, from the user interface to API responses and document delivery.

Architecture: users, React and Vite frontend, backend services with Elasticsearch, data and storage, monitoring and QA
From the React interface to the API, cache, Elasticsearch, and document storage, with integrations ready for AI and semantic search.

RESULTS

A FASTER READING EXPERIENCE AND A LONG-TERM TECHNICAL FOUNDATION

10x faster image delivery

By switching to cacheable static resources, image delivery time dropped from 600 ms to approximately 60 ms.

Smooth navigation and reading

Fewer requests, smaller API responses, and parallelized operations reduced delays in frontend workflows.

Optimized PDF viewer

Unnecessary loads are avoided, and documents are browsed naturally by readers.

Rising Lighthouse scores

After the optimizations, the platform achieved Lighthouse scores of 80/86/92/100.

Reduced technical debt

Updating libraries, refactoring components, and implementing Vite.js reduced technical debt.

Semantic search foundation

The Elasticsearch upgrade prepares the platform for retrieving information by meaning and context.


Interested?

Do you have a mature web application that has become slow? We start with a performance audit and prioritize the interventions with a visible effect for users. Let's talk.

TECHNOLOGIES AND METHODOLOGY

  • Services: performance audit, web application modernization, frontend refactoring, API and cache optimization, PDF viewer optimization, search engine upgrade, monitoring and QA.
  • Tech: React, Vite.js, JavaScript, REST/API, Elasticsearch, PDF viewer, cache, Node.js, PostgreSQL, Lighthouse.
  • Methodologies and best practices: initial analysis, prioritization, refactoring, testing and QA, launch and bug fixing.
  • Standards: ISO 9001 (quality), ISO 27001 (information security), ISO 42001 (AI management).

Quick Questions

How can a React web application be made faster without a complete rewrite?

Through a performance audit and targeted interventions: refactoring components with unnecessary renders, updating libraries, moving to Vite, parallelizing requests, and reducing API responses to the data each screen needs.

How was image delivery made 10 times faster?

Covers and PDF pages were separated as cacheable static resources served from a dedicated service, and delivery time dropped from 600 ms to approximately 60 ms.

Why does an Elasticsearch upgrade help semantic search?

The upgrade reorganized the existing indices with compatibility for semantic and hybrid search, so information can later be retrieved by meaning and context, not only by keywords.

What is the TLDR (conclusion)?

This case study shows that the performance of a mature web application comes from optimizing the entire path, from the number of interface requests and API response sizes to caching and PDF page loading, not from a complete rewrite.

Cătălin Chivu

Article written by

Cătălin Chivu

Software Engineer

See on LinkedIn →

Read more

Interested?

Interested?

Let's talk

Similar stories


B2B eCommerce Portals Integrated with SocrateCloud and Pluriva
Case Study
B2B eCommerce Portals Integrated with SocrateCloud and Pluriva
Case Study: How OPTI integrated three B2B WooCommerce eCommerce portals with the SocrateCloud and Pluriva ERPs, delivering personalized pricing, corporate accounts, and duplicate-free bidirectional synchronization.
Case Study: HubSpot Integration for Sports Ticketing (100,000+ Tickets)
Case Study
Case Study: HubSpot Integration for Sports Ticketing (100,000+ Tickets)
How OPTI integrated the vivenu ticketing platform with HubSpot for a professional basketball club, consolidating over 100,000 tickets and building a 360° fan profile.
Case Study: Implementing schema.org / JSON-LD for GEO (AI Search) in B2B and eCommerce
Case Study
Case Study: Implementing schema.org / JSON-LD for GEO (AI Search) in B2B and eCommerce
Case Study: How we built reusable semantic graphs for three websites (B2B and e-commerce) using server-side schema.org / JSON-LD, achieving more stable indexing, ~70% GSC click growth, and the first AI Overviews.