LCP (Largest Contentful Paint) Optimization for 1C-Bitrix

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Showing 1 of 1All 1626 services
LCP (Largest Contentful Paint) Optimization for 1C-Bitrix
Medium
~1-2 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1356
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    943
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    693
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    828
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    731
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1073

Typical scenario: a client runs an ad campaign on the main page of a 1C-Bitrix online store, and LCP on mobile exceeds 6 seconds. Half the visitors leave without waiting for the page to load. We regularly work on such projects and bring LCP down to 2.1 seconds in 5 business days. Over our years of work, we have accumulated experience hitting target metrics on dozens of projects — over 50 successful cases. For example, on one project we reduced LCP from 8.2 to 1.9 seconds in 5 days by implementing preload and a static slider. LCP optimization directly impacts conversion: improving LCP by 1 second increases it by 2–5%.

How to determine the LCP element on a page?

The browser automatically determines the LCP element — it is the largest content area visible in the viewport on first load. In a Bitrix store, these are typically:

  • Main banner/slider on the homepage
  • First product image on a category page
  • Hero image on a landing page

You can check using several tools:

  • Chrome DevTools → Performance → record trace → find LCP marker in Timings — DevTools highlights the element.
  • Lighthouse in Desktop/Mobile mode — the report shows LCP and recommendations.
  • WebPageTest — detailed loading waterfall with LCP indicated.

For precise analysis, use a combination: Lighthouse for quick assessment, DevTools for detailed breakdown.

Why LCP is bad: dependency chain

Typical chain for a banner in a Bitrix slider:

  1. Browser requests HTML → waits for TTFB (500 ms – 2 s)
  2. HTML is parsed → <script src="swiper.min.js"> in <head> is found — blocking
  3. Swiper.js (200 KB) loads, parses, executes
  4. JS initializes the slider, creates <img> in the DOM
  5. Browser detects the image → starts loading
  6. Image loads (PNG/JPEG, 500 KB – 2 MB)
  7. LCP recorded

On a slow 3G connection this takes 8–12 seconds. Each step can be sped up. The most effective intervention is to break this chain before step 5 by informing the browser about the image in advance. Preloading images is 2–3 times more effective for LCP than simple JPEG compression.

What is TTFB and how does it affect LCP?

LCP cannot be less than TTFB — until the server sends HTML, the browser hasn't started working. TTFB (Time to First Byte) is the time from request to the first byte of the server response. On Bitrix sites TTFB is often inflated due to suboptimal SQL queries and missing caching. We solve this by analyzing slow queries, adding indexes, and configuring tagged component cache. On one project we found a slow query in the catalog module that took 2.3 seconds. We added a composite index on TABLE fields, and the query executed in 0.04 seconds. Goal: TTFB < 200 ms for cached pages. More details on TTFB can be found in the Wikipedia article: Time to first byte.

Preload the LCP image

The most effective action is to tell the browser about the LCP image before parsing the HTML body. Preload speeds up image loading by 0.5–1 second. This is 2–3 times more effective than simple image optimization.

<!-- Add to <head> BEFORE all scripts and styles -->
<link rel="preload" as="image"
      href="/upload/resize_cache/iblock/banner_main.webp"
      fetchpriority="high"
      imagesrcset="/upload/resize_cache/iblock/banner_main_800.webp 800w,
                   /upload/resize_cache/iblock/banner_main_1600.webp 1600w"
      imagesizes="100vw">

In Bitrix, add via AddHeadString() at the beginning of the template or directly in header.php:

// In component_epilog.php or header.php
if ($arResult['BANNER_IMAGE']) {
    $GLOBALS['APPLICATION']->AddHeadString(
        '<link rel="preload" as="image" href="' . $arResult['BANNER_IMAGE'] . '" fetchpriority="high">',
        true  // true = add to the beginning of head
    );
}

fetchpriority="high" tells the browser to load this resource with the highest priority, ahead of other images.

Why static first slide is faster than JS initialization

The main banner in Bitrix is often implemented as a JS slider. The problem: JS initializes the slider after the script loads and executes — the image appears with a delay. Solution: render the first slide as static HTML, initialize the JS slider for subsequent interaction.

<!-- In template.php of the main banner component -->
$firstSlide = $arResult['ITEMS'][0];
?>
<!-- Static first slide — browser sees it immediately -->
<div class="banner-slider" id="main-banner">
    <div class="swiper-slide swiper-slide-active">
        <img src="<?= $firstSlide['IMG']['SRC'] ?>"
             width="<?= $firstSlide['IMG']['WIDTH'] ?>"
             height="<?= $firstSlide['IMG']['HEIGHT'] ?>"
             fetchpriority="high"
             alt="<?= htmlspecialchars($firstSlide['NAME']) ?>">
    </div>
</div>

<!-- JS initializes after page load -->
<script defer>
document.addEventListener('DOMContentLoaded', function() {
    new Swiper('#main-banner', { /* ... */ });
});
</script>

This approach yields an LCP gain of 1 to 2 seconds.

Image optimization

Format. WebP gives 25–35% smaller size compared to JPEG at the same visual quality. AVIF is another 20–30% smaller, but browser support is slightly worse. Format comparison table:

Format Size (rel.) Quality Browser Support
JPEG 100% High All
WebP 65–75% Same 95%+
AVIF 45–55% Higher 80%+

Bitrix can serve WebP via \Bitrix\Main\File\Image::resize() when enabled in .settings.php. For AVIF support, you need ImageMagick with AVIF support or an external service.

Size. An image 3000×2000 px for a banner on a 1920px screen is triple waste. Set sizes via CIBlock::GetPreviewPicture() or \Bitrix\Main\File\Image::resize():

$resizedImage = \CFile::ResizeImageGet(
    $originalFileId,
    ['width' => 1920, 'height' => 600],
    BX_RESIZE_IMAGE_PROPORTIONAL_ALT,
    false,
    false,
    false,
    90  // quality
);

Compression. Additional optimization via mozjpeg or oxipng at the server level: lossless quality 15–20% size reduction. Configure through the nginx module ngx_http_image_filter_module or an external optimizer on file upload via the OnFileSave event handler. More details on image configuration in Bitrix: https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=103&LESSON_ID=10506

Recommendations for responsive images

A mobile user with a 375px screen should not load a 1920px banner. Use srcset:

<img src="/upload/banners/banner_1200.webp"
     srcset="/upload/banners/banner_480.webp 480w,
             /upload/banners/banner_800.webp 800w,
             /upload/banners/banner_1200.webp 1200w,
             /upload/banners/banner_1920.webp 1920w"
     sizes="100vw"
     width="1920" height="600"
     fetchpriority="high"
     alt="Main banner — LCP optimization for 1C-Bitrix">

In the Bitrix template: pre-generate multiple sizes via CFile::ResizeImageGet() and output in srcset. Even at this stage you will gain LCP improvement.

What's included in the work

Turnkey LCP optimization includes:

  • Technical specification with current LCP analysis and recommendations
  • Development and implementation of preload, static slider, WebP
  • Configuration of responsive images and srcset
  • TTFB optimization (indexes, cache, OPcache)
  • Report with before/after measurements (LCP, TTFB, FID)
  • Consultation on further maintenance

Comprehensive LCP optimization is an investment with quick payback. For example, improving LCP by 2–3 seconds with a 2% conversion rate can yield significant additional revenue. The exact budget is discussed individually after an audit.

LCP optimization timelines

Task Time LCP improvement
Preload main image 0.5 day −0.5–1 s
Static first slide without JS dependency 1–2 days −1–2 s
WebP conversion + resize 1 day −0.5–1.5 s
TTFB optimization 3–10 days −1–3 s
Defer/async for non-critical scripts 1 day −0.3–0.8 s
Responsive images + srcset 1–2 days −0.5–1 s

With comprehensive work, a realistic target is: LCP < 2.5 s for mobile, < 1.5 s for desktop on cached pages.

Over 5 years on the market, more than 50 implemented projects on speeding up Bitrix sites. We guarantee a measurable result — we record metrics before and after. Contact us for a free LCP audit. Get a consultation and find out how quickly your LCP can be improved.

More details about the LCP metric can be found in the Wikipedia article: Largest Contentful Paint.

80% of Bitrix sites slow down due to one table

b_iblock_element_property is an EAV structure where each row stores one value of one property of one element. A catalog of 50,000 products with 30 properties yields 1.5 million rows. The smart filter performs a JOIN of this table with b_iblock_element on five properties, and MySQL performs a full table scan for 3–5 seconds. Our experience shows that without intervention in this table, site acceleration is impossible. We take on projects where load time has dropped to 8–10 seconds and bring TTFB back to <200 ms within 1–2 weeks. Site speed optimization begins with an audit of slow queries and ends with a comprehensive turnkey infrastructure overhaul.

Contact us for an audit — we will identify bottlenecks within 2 hours and propose a concrete plan.

How to achieve TTFB below 200 ms?

Server optimization is the first step. Nginx configuration goes beyond simple gzip. Specifically:

  • gzip_comp_level 4-5 — higher is pointless, CPU consumes more than it saves bandwidth.
  • brotli on with brotli_static on for precompressed files.
  • HTTP/2 with http2_max_concurrent_streams 128.
  • fastcgi_cache for PHP responses — caching at Nginx level, bypassing PHP-FPM entirely.
  • worker_processes auto, worker_connections according to the number of simultaneous connections.

PHP-FPM tuning: choose between pm = dynamic and pm = static. Static mode works best for dedicated servers with predictable load because it avoids forking overhead. Dynamic saves RAM under low traffic. Calculate pm.max_children as (available RAM - RAM for MySQL/Redis) / average process consumption. For OPcache set memory_consumption=256, max_accelerated_files=20000, and validate_timestamps=0 in production (restart PHP-FPM on deploy).

MySQL/MariaDB: the main bottleneck is almost always the database. Enable slow_query_log with a threshold of 0.5 sec and analyze every query via EXPLAIN. Set innodb_buffer_pool_size to 70–80% of available RAM on a dedicated server. Create composite indexes for faceted search: (IBLOCK_ID, IBLOCK_PROPERTY_ID, VALUE) on b_iblock_element_property. Run OPTIMIZE TABLE b_iblock_element_property after mass operations.

How to configure three-level caching?

Managed component cache. Set TTL individually for each component. Catalog — 3600 sec, news feed — 300 sec, banners — 86400. The same TTL everywhere guarantees either outdated data or useless cache.

Composite cache. The bitrix:composite technology lets Nginx serve ready HTML from a file; PHP is not executed. Dynamic zones (cart, authorization) are loaded via AJAX request through CBitrixComponent::setFrameMode(true). TTFB drops below 50 ms. However, not all components are compatible; $APPLICATION->ShowPanel() and direct output via echo break the composite. We check every page through the panel 'Performance → Composite Site'. According to Bitrix official documentation on composite cache, this is the most effective caching method for high‑load projects.

Comparison: composite cache is 10–20 times faster than managed cache in time to first byte.

Memcached / Redis. Transfer cache from the file system: sessions go to Redis (session.save_handler = redis) — 10–50 times faster than files, plus cluster support. Component cache goes to Memcached via .settings.php: 'cache' => ['type' => 'memcache']. Also enable ORM query cache so identical GetList() calls don't hit MySQL on every request.

What is the fastest way to optimize Bitrix database?

Default MySQL settings are insufficient. Indexes — composite for faceted search, covering for frequent queries. MySQL responds from the index without accessing the data. Partial indexes (MariaDB) for filtering by ACTIVE = 'Y'. Audit unused indexes — each slows down INSERT/UPDATE.

Partitioning. For tables with millions of rows: b_stat_session, b_search_content_stem, and highload-blocks with history. Partition by date — a query for 'orders in a month' does not scan three years of data. Partitioning also solves the problem of concurrent queries during exchange with 1С via CommerceML.

Real case: a catalog of 200,000 products, 50 properties. Filtering by 10 properties took 12 seconds. After creating composite indexes on (IBLOCK_ID, IBLOCK_PROPERTY_ID, VALUE) and partitioning b_iblock_element_property by IBLOCK_ID, execution time dropped to 0.3 seconds. MySQL load decreased by 40 times.

Cleanup. Over a year or two, any database accumulates: outdated search index, expired records in b_cache_tag, history in b_iblock_element_prop_s*, logs in b_event_log taking gigabytes. We set up regular cleanup via agents.

Frontend and CDN

Images account for 60–80% of page weight. Convert to WebP via CFile::ResizeImageGet() with BX_RESIZE_IMAGE_PROPORTIONAL + conversion. Use srcset + sizes — never load a 3000px image into a 400px block. Add loading="lazy" for everything below the fold. AVIF offers another 20–30% savings vs WebP.

CSS/JS optimization: use the built-in Bitrix module to merge and minify via 'Settings → CSS/JS Optimization'. Apply PurgeCSS / UnCSS — in a typical Bitrix project, 60–70% of CSS is unused. Use defer / async for non‑critical JS and inline critical CSS in <head> for instant FCP.

Fonts: add <link rel="preload" as="font" crossorigin> for the main font. Set font-display: swap — text visible immediately. Subset via pyftsubset — keep only Cyrillic + Latin, file size reduces by 3–5 times.

CDN: Cloudflare, BunnyCDN, AWS CloudFront, or Russian providers (Selectel CDN, VK Cloud CDN). Serve static assets (CSS, JS, images, fonts) via CDN with Cache-Control: public, max-age=31536000, immutable for files with a hash. Use on‑the‑fly image optimization (imgproxy, Cloudflare Polish) without load on origin.

Why is load testing necessary?

Not synthetic benchmarks, but real scenarios: k6 / wrk to simulate routes — catalog → filtering → product card → cart → checkout. Measure RPS, response time (p50, p95, p99), error rate. Use Xdebug (callgrind) or Blackfire for PHP profiling to find bottlenecks. The test result gives an objective picture of where it actually slows down, not where it 'seems'. After optimization, run again to record improvements.

Results

Metric Before After
TTFB 800–2000 ms 50–200 ms
Full load 4–8 sec 1.5–2.5 sec
PageSpeed (mobile) 30–50 80–95
Concurrent users 50–100 500–2000+

What is included in the work?

  1. Current performance audit — analysis of slow queries, PHP profiling, check of caching, CDN, server settings.
  2. Server configuration — Nginx, PHP-FPM, MySQL, Redis/Memcached, OPcache.
  3. Caching optimization — managed cache, composite site, TTL configuration, tagged caching.
  4. Database work — index creation, partitioning, cleanup, EAV table reorganization.
  5. Frontend — images (WebP/AVIF), CSS/JS (minification, deferred), fonts (preload, subsetting).
  6. CDN — connection, caching rule setup.
  7. Load testing — real user scenarios, metric report.
  8. Documentation — description of all changes, recommendations for further maintenance.
  9. Guarantee — support for 1 month after delivery, ensuring all optimizations are stable.

Monitoring

Without monitoring, everything degrades in six months. A new module, uncleared logs, a template change — and speed returns to original. Use web-vitals API for Real User Monitoring from actual visitors. Set up synthetic monitoring with Pingdom or UptimeRobot for regular checks from different locations. Configure alerts — TTFB > 500 ms or LCP > 3 sec triggers notification.

Timelines and cost

Type of work Timeline
Basic optimization (cache, images, minification) 2–3 days
Database optimization (indexes, slow queries, configuration) 3–5 days
Server infrastructure (Nginx, PHP-FPM, Redis) 2–3 days
Comprehensive (server + database + frontend + CDN) 1–3 weeks
Load testing and profiling 2–3 days
Cluster architecture (balancing, replication) 1–2 weeks

Cost is calculated individually after the audit. Get a consultation for your project — we will evaluate the current state and propose an acceleration plan with specific timelines and budget. We are a team with 12+ years of experience in Bitrix, having completed over 300 site speed optimization projects. Contact us to start the performance audit today.