Package providers

MemoryPackProvider

This provider stores the packages in memory, and self controls the caching by ETag. MemoryPackProvider generates a key for each version of package and sends it to the browser. When the browser sends back an ETag in request, MemoryPackProvider will check it with lastest version of package. If this is different, MemoryPackProvider push the new content to the browser, otherwise, it will return a Not Modified (304) response status.
Its disadvantages in that request processing involved the process of ASP.NET.

<!--
  url (required)
    Base url for packages
  cacheDuration = 0
    Browser cache live time (in seconds).
  setLastModified = false
    Use LastModified header for caching (by default ETag used).
-->
<provider type="memory" url="webpacker.axd" cacheDuration="0" setLastModified="false" />

FileSystemPackProvider

This provider stores the packages in file system and gives url to those files. Generated files can be cached on the proxy/front-end server. If the package is updated, the file name will be changed, so any user will always have the latest version of resources.
You must have write permissions to the output folder.

<!--
  outputPath (required)
    Folder path for generated packages
  versioning (=true)
    If true file name of package will be defined by name and version, otherwise only by name (version defined in query string).
-->
<provider type="fileSystem" outputPath="~/resources" versioning="true" />

StaticPackProvider

This provider stores the packages in file system (as FileSystemPackProvider), but it does not rebuild packages when resources have changed. So you can disable monitoring of resources. StaticPackProvider takes a pre-built packages at startup. You can pre-built packages by WebPackerTool.exe.
It's especially useful for web farms and highload.

<!--
  source (required)
    File with information about the pre-built packages (generated by WebPackerTool.exe)
-->
<provider type="static" source="~/resources/packs.build.xml" />

Last edited Sep 21, 2011 at 6:04 PM by pshkarin, version 3

Comments

No comments yet.