samedi 25 avril 2020

Slow photo loading in Laravel

I have Laravel code below in my project on local machine and running it on development mode. Photos are stored in public folder. In current example I have 17 photos in mobile_photos folder, the weight of all of them is 572kB. The problem is slow loading of mentioned images even they are not heavy, exact time you can find on photo below. I expected to load these ptohos in ms but as you can see loading time for one photo is more then more then 1s. Any idea how to fix this problem?

  <link rel="stylesheet" href="/css/justifiedGallery.css" />       
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script type="text/javascript" src="/js/jquery.justifiedGallery.js"></script>

    <div id="basicExample" class="justified-gallery">
    @foreach ($photo as $photo)                       

    <a href="">
    <img alt="caption for image" src=""/>
    </a>  
    @endforeach     
    </div>

  <script>
        $( document ).ready(function() {                
            $("#basicExample").justifiedGallery({
                rowHeight : 120,
                lastRow : 'justify',
                margins : 3                    
            });           
        });          
   </script>

enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire