You are here:
Vanderbilt Biostatistics Wiki
>
System Web
>
PageOptimizerPlugin
(29 Oct 2013,
AdminUser
)
(raw view)
E
dit
A
ttach
---+!! %TOPIC% %SHORTDESCRIPTION% %TOC% ---++ Description This plugin is used to clean up the html page foswiki renders by rewriting and/or removing code not required in html5. It also compresses all stylesheets and javascript code used in a page thus reducing the number of http requests that are normally required to load a page including all of its assets. These changes only apply to output of type =text/html=, not to any other kind of output. ---++ Rewrite of html markup The following list of transformations is performed: * all one-liner html comments are removed * any markup following the closing =</html>= is removed * sequences of =<p></p><p></p>...= are collapsed into one * script blocks of type =text/javascript= don't need a =type= argument anymore as that's the default in html5 * style blocks of type =text/css= don't need a =type= argument anymore as that's the default in html5 * citations produced by foswiki's =>= at the beginning of a line are collapsed into one =<div>= block of type =foswikiCite=, or =foswikiBlockCite= when there are multiple citation lines following * =<verbatim>= blocks contained in template comments are rewritten to look nicer for better readability of view templates coded in topics ---++ Combining and compressing stylesheets and javascript <nop>%TOPIC% is reading all css and js files loaded into a page and combines them into one each. Only stylesheets for =media="all"= are processed. Media-specific styles aren't touched. All css files are parsed and rewritten so that contained =@import()= and =url()= statements are working as expected. The combined css (js) files are cached and reused by pages that have the same profile of assets loaded into the page. Or expressed the other way around: each page that differs in the set of assets will get its own combined stylesheet (javascript). This is still object of optimization. <nop>%TOPIC% is able to gather statistics about how often specific css (js) files have been used while combining them with others. This feature is switched off by default but can be enabled using the ={GatherStatistics}= switch in =configure=. Once statistics are enabled, the plugin will record css and js use. Results can be printed out using the =statistics= REST handler. For now, this is a rather crude statistic how often css (js) file have been used per pages visited. E.g. a value of 100% means: this asset has been used on all pages, whereas lower values indicate a decreasing frequency of those files being used. All css and js files will be cached in plain text as well as encoded =gzip= compressed for browsers supporting on-the-fly decompression of js and css files. The cache of stylesheets and javascript files can be refreshed manually by using the =refresh= url parameter: * %SCRIPTURL{"view"}%/%WEB%/%TOPIC%?refresh=on (or cache): refresh the css and js cache for the current page * %SCRIPTURL{"view"}%/%WEB%/%TOPIC%?refresh=css : refresh the css files of the current page * %SCRIPTURL{"view"}%/%WEB%/%TOPIC%?refresh=js : refresh the js files of the current page * %SCRIPTURL{"view"}%/%WEB%/%TOPIC%?refresh=all : purge the complete cache ---++ Installation Instructions You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server. Open configure, and open the "Extensions" section. Use "Find More Extensions" to get a list of available extensions. Select "Install". If you have any problems, or if the extension isn't available in =configure=, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help. ---++ Info <!-- * Set SHORTDESCRIPTION = Optimize html markup, as well as js and css --> | Author(s): | Michael Daum| | Copyright: | © 2012-2013 Michael Daum http://michaeldaumconsulting.com | | License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] | | Release: | 0.10 | | Version: | 0.10 | | Change History: | <!-- versions below in reverse order --> | | 30 May 2013: | fixed handling if IE conditional comments; no js or css optimization by default, only html cleanup | | 07 May 2012: | added feature to make at least some <p>s real paragraphs for improved typographics | | 02 Apr 2012: | added ={ExcludeJavaScript}= and ={ExcludeCss}= feature to specify files not to be processed by the asset optimizer | | 26 Mar 2012: | added flags to turn on/off specific optimizations | | 20 Mar 2012: | added statistics module | | 19 Mar 2012: | initial checkin | | Dependencies: | <table class="foswikiTable" border="1"><tr><th>Name</th><th>Version</th><th>Description</th></tr><tr><td align="left">URI</td><td align="left">1.54>=</td><td align="left">Required.</td></tr></table> | | Home page: | Foswiki:Extensions/%TOPIC% | | Support: | Foswiki:Support/%TOPIC% |
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Edit
w
iki text
|
M
ore topic actions
Topic revision: r2 - 29 Oct 2013,
AdminUser
System
Log In
Toolbox
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
BeginnersStartHere
TextFormattingRules
Macros
FormattedSearch
QuerySearch
DocumentGraphics
SkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
SiteTools
DefaultPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
Archive
Main
Sandbox
System
Register
|
Log In
Copyright © 2013-2020 by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki?
Send feedback