---
# System prepended metadata

title: pagespeed

---

# pagespeed

**NOTE:** All screenshots are either from https://developers.google.com/speed/pagespeed/insights/?url=hands.ru or google chrome performance tool

## Reduce initial server response time

As you can see from the image below, our server response time is 880ms:

![](https://i.imgur.com/69SDfvL.png)

### Hypothesis #1 [reduce the bundle size]

As we can see from the resource treemap we are loading 1.4MB of data, and nearly 50% of that data is not used on this specific page (please note that reduction of unused js also reduces unnecessary parsing done on client side):

![](https://i.imgur.com/LxVAdph.jpg)
        
### Hypothesis #2 [use more optimal compression algorithm]

I’m still thinking about this point because I don’t know how it works internally. All that I know is that we are using a compression middleware in order to serve compressed files.

This one we are using: http://expressjs.com/en/resources/middleware/compression.html

I think about using brotli compression for our website resources, here you can see the side-by-side comparison of node.js gzip and brotli compression (taken from this [article](https://medium.com/@april9288/how-i-got-a-100-lighthouse-score-with-my-react-app-2b676ef62113)):

![](https://i.imgur.com/lNGgPEj.png)


## Reduce the impact of third-party code

As you can see from the image below, yandex metrika and google tag manager are two major points here:    

![](https://i.imgur.com/YCxgW7M.png)

### Hypothesis #1 [google tag manager blocks our content]

I decided to follow [this advice](https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/loading-third-party-javascript/?utm_source=lighthouse&utm_medium=unknown#chrome_devtools_network_request_blocking) from google pagespeed and see the page improvement if I simply block requests to google tag manager and google analytics:

![](https://i.imgur.com/yfQ1X3H.png)

As you can see load event has fired on 430ms, now without blocking GTM requests:

![](https://i.imgur.com/osHPdov.png)


Now we have 750ms untill the onload event fire. Seems like this request blocks our GQL batch request

### Hypothesis #2 [yandex metrika blocks our content]
        
Blocking request to yandex/metrica/tag.js results in the same 430ms. But I find the most interesting part in the fact that **now request to google analytics does not block GQL batch request.**

![](https://i.imgur.com/7mRqNG9.png)
