0

I have an application where it search images that are stored in the database and displays the result (with pagination). Currently every time the next page is loaded our whole site is reloaded. Hence, our site is noticeably sluggish.

I was looking into iStockPhoto and see that only the images content is loaded and their performance is much better than mine.

I am using Solr (which to me seems slow.. anything I'm missing? I thought Solr is supposed to be quick. Haha) to store and retrieve images.

SO !!

my question to you gents/ladies is if I want to allow only the pagination contents to be refreshed when next page is hit, is there a lot that I have to do? Such as changing Controllers, Views, and etc.?

Thank you so much!

This is the code I have:

<table>
<tr>
    <td>...</td> 
    <td valign="top" style="width: 100%">
        <div id="imageList" class="imageList">
            @Html.Partial("AssetManagerSelection", new FacetsWidget
                                        {
                                            SelectedFacetNodes = Model.Search.SelectedFacetNodes
                                        })
            @{
                var pagerInfo = new PaginationInfo
                {
                    PageUrl = Url.SetParameter("page", "!0"),
                    CurrentPage = Model.Search.PageIndex,
                    PageSize = Model.Search.PageSize,
                    TotalItemCount = Model.TotalCount,
                };
            }      
            @Html.Partial("AssetManagerPager", pagerInfo)
            @if (pagerInfo.CurrentPage <= pagerInfo.LastPage)
            {
                <ul class="thumbnailsList">
                    @{var thumbnailIndex = 1;}
                    @foreach (var item in Model.MatchingItems)
                    {
                        var thumbnailClass = string.Empty;
                        if (Model.Search.ThumbnailSize == CacheLevel.DetailsView)
                        {
                            thumbnailClass = "thumbnailImagesS";
                        }
                        else
                        {
                            thumbnailClass = "thumbnailImagesM";
                        }
                        <li>
                            <div class="@thumbnailClass">
                                @Html.Partial("ItemThumbnail", item)
                            </div>
                            @{thumbnailIndex++;}
                        </li>
                    }
                </ul>
                @Html.Partial("AssetManagerPager", pagerInfo)
            }
        </div>
    </td>
</tr>

KoalaD
  • 337
  • 1
  • 4
  • 12
  • 1
    If your views are done right, you probably only have to edit your views. Before we can tell what you'll have to change, can you post what you have now? – Ron Sijm Jan 12 '12 at 18:11
  • AJAX is not a necessary requirement to produce non-sluggish websites. Solr was not designed to store and retrieve images. – Mauricio Scheffer Jan 12 '12 at 19:31
  • @MauricioScheffer sorry for my stupidity. I use Solr to search our stored images. It just slipped my tongue. And I understand I don't necessarily need AJAX but in my case I think it can definitely help the performance. Thank you :) – KoalaD Jan 12 '12 at 20:52
  • @RonSijm I will post it asap! Thanks! – KoalaD Jan 12 '12 at 20:53
  • @KoalaD : if you feel Solr is slow for you I recommend posting a new question with more details about that, maybe we can help... – Mauricio Scheffer Jan 12 '12 at 21:49
  • @MauricioScheffer I asked a separate question. I hope it is more clear. I can't seem to explain things well today. Or maybe anytime for that matter. Haha Thanks – KoalaD Jan 12 '12 at 22:11
  • I think you'll have to make your question narrower and more precise, otherwise you won't get any quality answers. – Mauricio Scheffer Jan 13 '12 at 15:24

0 Answers0