Banner

Using RAMDisk with Sitefinity to Speed up Development locally

Mar 14, 2018
()
Are you a fan of the magical gears in Sitefinity? How many times a day to find yourself starring at these spinning gears while Sitefinity is compiling the kitchen sink and Visual Studio caching galore of data for assemblies and many other things.

If you are a consultant charging your customer per hour, ignore this post, this is not for you, this post will cause you a significant reduction in pay.

For those that need to get things moving faster, RAMDISK might be what the doctor ordered.

Everytime you do a build or make changes that require a restart of the application, IIS is compiling and pre-fetching the application. After creating the cache it finally serves the files to the browser. Add to that the Sitefinity Initializing process and it all takes a lot of time and resources.

A possible solution could be to move the temporary files that are generated by IIS to a RAM disk. This way the temporary files are written to memory and not to the disk, which leads to an overall performance boost while doing development for Sitefinity.  Even if you have fast SSD drives, still the RAM will be much faster.

  1. Download RAMDisk.
    So to make use of this we need to download a little program called ‘RAMDisk’.
    Download RAMDISK from Dataram
  2. Configure RAMDisk
    Configure RAMDisk to create a new drive (in memory)
    In general: a Sitefinity project renders about +/- 500MB on files to your disk, so you have to try and see what size your RAMDisk should be. I usually reserve about 2GB of memory, since I use it on multiple projects.
  3. Configure Sitefinity to use this new drive
    You can configure your Sitefinity app to write the temporary files to this new drive from the web.config. Since Sitefinity is just an ASP.NET Web Application, it means that you can also apply this to a normal ASP.NET application.

    Edit the web.config and make sure that the tempDirectory attribute of the compilation node is set this way:

<compilation debug="true" targetFramework="4.5" numRecompilesBeforeAppRestart="2000" tempDirectory="G:\RamDiskCache\">

Restart your application and you’ll see the temporary files appear inside the location you configured.
Load more reviews
You've already submitted a review for this item
|
()

Copyright © 2018 Alain "Lino" Tadros