Документ взят из кэша поисковой машины. Адрес
оригинального документа
: http://wiki.cs.msu.ru/System/PageOptimizerPlugin
Дата изменения: Unknown Дата индексирования: Sun Apr 10 03:02:12 2016 Кодировка: koi8-r |
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 typetext/html
, not to any other kind of output.
The following list of transformations is performed:
</html>
is removed
<p></p><p></p>...
are collapsed into one
text/javascript
don't need a type
argument anymore as that's the default in html5
text/css
don't need a type
argument anymore as that's the default in html5
>
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
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.
PageOptimizerPlugin 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:
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 inconfigure
, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
Author(s): | Michael Daum | ||||||
Copyright: | © 2012-2013 Michael Daum http://michaeldaumconsulting.com | ||||||
License: | GPL (Gnu General Public License) | ||||||
Release: | 0.10 | ||||||
Version: | 0.10 | ||||||
Change History: | |||||||
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: |
|
||||||
Home page: | Foswiki:Extensions/PageOptimizerPlugin | ||||||
Support: | Foswiki:Support/PageOptimizerPlugin |