Webskin Usage Summary

Matt was working on the FarCry Blog plugin and needed an easy way to determine which webskins were no longer required. The Webskin Usage Report provides a summary of all webskins in the system and how many times each one has been called on the site. You will need to turn on the logging for a period of time and either wait or trawl through the site yourself.

The following snippet needs to be placed in fourq.cfc just above where the webskin is included. In 5.2 it is in the runView()

<cfif structKeyExists(request.mode, "bLogWebskinUsage") AND request.mode.bLogWebskinUsage> <cflock type="exclusive" name="webskinUsageQty_#stCurrentView.typename#_#stCurrentView.template#" timeout="1" throwontimeout="false"> <cfparam name="application.stCoapi.#stCurrentView.typename#.STWEBSKINS.#stCurrentView.template#.webskinUsageQty" default="0" /> <cfset application.stCoapi[stCurrentView.typename].STWEBSKINS[stCurrentView.template].webskinUsageQty = application.stCoapi[stCurrentView.typename].STWEBSKINS[stCurrentView.template].webskinUsageQty + 1 /> </cflock> </cfif>

To turn on webskin usage logging. Add into your projects /config/_serverSpecificRequestScope.cfm

The following is a report you can drop into your webtop to review the results. (ie. save in the projects ./customadmin branch and create a reference in your project's webtop XML)

https://gist.github.com/215522

821 views and 0 responses