Style.background-image -> Too many requests are created


#1

Using the following functions, we are creating random background images.

Since we import six lists at a time, we need six requests, but we have a lot more.

page.html

  <ion-list class="rank_list">
    <ion-item *ngFor="let r of data">
      <div class="row match-height">
        <div class="col-6 col-xs-6 col-xl-6 col-md-6 col-sm-6">
          <div class="blog-card spring-fever" [style.background-image]="getBackground()">

page.ts

  getBackground() {
    console.log('getBackground called.');
    let rand = Math.floor(Math.random()*999999)+1;
    return this.Sanitizer.bypassSecurityTrustStyle(`url('https://source.unsplash.com/200x300/?cat` + `,random` + rand);
  }

Very many requests are generated

Are we using the wrong function? Please advise.