3

for some reason the first request for every single pages on our site is pretty slow. 2nd hit and subsequent are good.

Thinking of applying a patch for CD per below:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <cacheSize>500MB</cacheSize>

  <template desc="mysitetemplate">{xxxxxxxx-8F46-4948-AE74-DA5B6B5AFA86}</template>

  <template desc="mysiteLayout">{xxxxxx-64EE-4919-9D41-02FD40FD1466}</template>

  <item desc="mySiteHome">{xxxxxx-DEA5-42EA-9C1C-8A5DF7E70EF9}</item>
  <children desc="mySiteMainIems">{xxxxxxxx-DEA5-42EA-9C1C-8A5DF7E70EF9}</children>
</configuration>

So that all the relevant items that uses layouts, templates defined above are prefetched. Also the home and its children as well.

Is this a good approach, has anyone done this before and faced any issues /worked well?

  • 1
    Is it an MVC solution? And if so, are you pre-compiling your Razor views or are they being compiled as-needed at runtime? – Mark Cassidy Nov 14 '16 at 11:59
  • How do we precompiled mark? Yep mvc – Nil Pun Nov 14 '16 at 12:04
  • Also, put your ASPNET Compilation Temp folder (in the <compilation /> element) on an SSD. – Richard Hauer Nov 14 '16 at 19:54
3

The Second request being served well is for the reason it is returned from Sitecore caches - Item Cache or even HTML Cache, if that is configured for the rendering. Adding to Prefetch Cache might help, and you can check whether the required item is returned from cache or not, using Sitecore Cache Admin marketplace module

But, If your first request is taking long time to load the page, I would suggest you to check in code - lets say a Custom pipeline or processor - which is called on every request. Or say, a rendering which is added in the main Default Layout of your website. If you are using something like say ShareThis component, its good to add it as ASYNC on page, and it doesn't add up to the page load.

PS: A Strong Advice: Please do not hide code issues using cache, you might be able to shoo it away for now, but it will reappear sometime in future and with a problem bigger in size.

2

I have done it before and its good to cache frequently used items. One thing to note is application start time increases with size of prefetch catch i.e when you reset app pool it might take more time depending on size of cache.

  • So, under configuration we can add as many template or item? OR we need to replace the existing ones that are under prefetch folder webdb configuration settings? – Nil Pun Nov 15 '16 at 10:48
  • We can add as many templates or items to config, however make sure total size of items does not exceed the cache size specified. Also make sure to allocate enough memory to app pool so that caches doesn't refresh frequently. you can monitor the utilization of cache using /sitecore/admin/cache.aspx and update sizes. – navincumar Nov 16 '16 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.