How to Optimize Web Page for Google Page Speed Insights

  • Thread starter Thread starter Raptor
  • Start date Start date
R

Raptor

Often our home page load speed for mobile is in the 70's range with Page Speed Insights and the biggest issues are:

- First Contentful Paint (2.0sec)

- Largest Contentful Paint (5.1 sec)


Site: https://scottspainting.com

Page Speed Insights Mobile Performance Ranking - 77

Contentful Paint times

I feel this may be due to the css or how we are loading the banner image for different size screens. The banner uses the css below to reference class="hero" which contains: background-image:url().

index.html:

Code:
<section class="hero" title="Omaha Painters, House Painters Omaha NE">          
        <div class="container">
            <div class="text-center banner-caption">
                <h1><span class="up">Premier </span><br><span class="banner-small up">Omaha painters</span><span class="banner-small wht"> Near Me </span><br><span class="banner-siding"><span class="wht">Specializing in</span> Siding Repair</span></h1><br>
                <a class="button-blue banner-button" href="mailto:xxxxx?subject=xxxx" title="Omaha's Premier Painting Service - Specializing in Siding Repair">SCHEDULE YOUR QUOTE</a></div>
        </div>
    </section>

The css has the different image size paths, not sure if this is leading to refreshing the page or not. The score is normally about 100 for Desktop but around 77 for Mobile.

css:

Code:
/* Mobile View */
.hero{ /* HomePage banner image */
    background-image:url("../images/exterior-painting/house-painting-contractors-omaha-nebraska-painters-550.webp");
    background-repeat:no-repeat;
    background-position:top center;
    background-size:100%;
    background-color:#333;
    padding:125px 0 0 0}

/* Tablet View */
@media (min-width:768px){
    .hero{padding:100px 0 0 0;background-image:url("../images/exterior-painting/house-painting-contractors-omaha-nebraska-painters-768.webp")}

/* Desktop View */
@media (min-width:1024px){
    .hero{background-position:50% 100%;background-size:cover;padding:100px 0 290px 0;background-image:url("../images/exterior-painting/house-painting-contractors-omaha-nebraska-painters-1578.webp")}

Looking for any help on how to:

Better optimize the different sized images between the 3 screen sizes, desktop, tablet, mobile

Not require each page to have a unique image url hardcoded in the css file, (Not sure a better way to do this while having the image display similarly.

I understand I can find some of the screen loading and refreshing info in Chrome Dev Tools, but I am having a hard time following that and coming up with a working solutions.

I have tested the code using only 1 background image (with a rather small file size) and it did not greatly affect the Page Load speed.

This leads me to believe the overall page loading or css order is causing excessive page refreshes, but I have not been able to identify where or how this is happening.

I have tried to remove all of the inline styles and control it all through a single css file.

Continue reading...
 
Back
Top Bottom