Advertisement
Munszu

pagespeed.conf

Oct 2nd, 2015
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.83 KB | None | 0 0
  1. <IfModule pagespeed_module>
  2. # Turn on mod_pagespeed. To completely disable mod_pagespeed, you
  3. # can set this to "off".
  4. ModPagespeed on
  5.  
  6. # We want VHosts to inherit global configuration.
  7. # If this is not included, they'll be independent (except for inherently
  8. # global options), at least for backwards compatibility.
  9. ModPagespeedInheritVHostConfig on
  10.  
  11. # Direct Apache to send all HTML output to the mod_pagespeed
  12. # output handler.
  13. AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html
  14.  
  15. # If you want mod_pagespeed process XHTML as well, please uncomment this
  16. # line.
  17. # AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER application/xhtml+xml
  18.  
  19. # The ModPagespeedFileCachePath directory must exist and be writable
  20. # by the apache user (as specified by the User directive).
  21. ModPagespeedFileCachePath "/var/cache/mod_pagespeed/"
  22.  
  23. # LogDir is needed to store various logs, including the statistics log
  24. # required for the console.
  25. ModPagespeedLogDir "/var/log/pagespeed"
  26.  
  27. # The locations of SSL Certificates is distribution-dependent.
  28. ModPagespeedSslCertDirectory "/etc/ssl/certs"
  29.  
  30.  
  31. # If you want, you can use one or more memcached servers as the store for
  32. # the mod_pagespeed cache.
  33. # ModPagespeedMemcachedServers localhost:11211
  34.  
  35. # A portion of the cache can be kept in memory only, to reduce load on disk
  36. # (or memcached) from many small files.
  37. # ModPagespeedCreateSharedMemoryMetadataCache "/var/cache/mod_pagespeed/" 51200
  38.  
  39. # Override the mod_pagespeed 'rewrite level'. The default level
  40. # "CoreFilters" uses a set of rewrite filters that are generally
  41. # safe for most web pages. Most sites should not need to change
  42. # this value and can instead fine-tune the configuration using the
  43. # ModPagespeedDisableFilters and ModPagespeedEnableFilters
  44. # directives, below. Valid values for ModPagespeedRewriteLevel are
  45. # PassThrough, CoreFilters and TestingCoreFilters.
  46. #
  47. ModPagespeedRewriteLevel PassThrough
  48.  
  49. # Explicitly disables specific filters. This is useful in
  50. # conjuction with ModPagespeedRewriteLevel. For instance, if one
  51. # of the filters in the CoreFilters needs to be disabled for a
  52. # site, that filter can be added to
  53. # ModPagespeedDisableFilters. This directive contains a
  54. # comma-separated list of filter names, and can be repeated.
  55.  
  56.  
  57. #ModPagespeedDisableFilters inline_css,inline_javascript,rewrite_javascript,remove_quotes
  58.  
  59. # Explicitly enables specific filters. This is useful in
  60. # conjuction with ModPagespeedRewriteLevel. For instance, filters
  61. # not included in the CoreFilters may be enabled using this
  62. # directive. This directive contains a comma-separated list of
  63. # filter names, and can be repeated.
  64.  
  65. ModPagespeedEnableFilters collapse_whitespacene_css
  66. ModPagespeedEnableFilters combine_javascript
  67. ModPagespeedEnableFilters extend_cache
  68. ModPagespeedEnableFilters inline_google_font_css
  69. ModPagespeedEnableFilters inline_css
  70. ModPagespeedEnableFilters inline_javascriptabove_scripts
  71. ModPagespeedEnableFilters rewrite_images
  72. ModPagespeedEnableFilters convert_jpeg_to_webp
  73. ModPagespeedEnableFilters convert_to_webp_lossless
  74. ModPagespeedEnableFilters inline_preview_images
  75. ModPagespeedEnableFilters insert_image_dimensions
  76. ModPagespeedEnableFilters prioritize_critical_css
  77. ModPagespeedEnableFilters remove_comments
  78. ModPagespeedEnableFilters remove_quotes
  79. ModPagespeedEnableFilters defer_javascript
  80.  
  81. # Explicitly forbids the enabling of specific filters using either query
  82. # parameters or request headers. This is useful, for example, when we do
  83. # not want the filter to run for performance or security reasons. This
  84. # directive contains a comma-separated list of filter names, and can be
  85. # repeated.
  86. #
  87. # ModPagespeedForbidFilters rewrite_images
  88.  
  89. # How long mod_pagespeed will wait to return an optimized resource
  90. # (per flush window) on first request before giving up and returning the
  91. # original (unoptimized) resource. After this deadline is exceeded the
  92. # original resource is returned and the optimization is pushed to the
  93. # background to be completed for future requests. Increasing this value will
  94. # increase page latency, but might reduce load time (for instance on a
  95. # bandwidth-constrained link where it's worth waiting for image
  96. # compression to complete). If the value is less than or equal to zero
  97. # mod_pagespeed will wait indefinitely for the rewrite to complete before
  98. # returning.
  99. #
  100. # ModPagespeedRewriteDeadlinePerFlushMs 10
  101.  
  102. # ModPagespeedDomain
  103. # authorizes rewriting of JS, CSS, and Image files found in this
  104. # domain. By default only resources with the same origin as the
  105. # HTML file are rewritten. For example:
  106. #
  107. ModPagespeedDomain www.magentotidehunter.co.uk
  108. #ModPagespeedDomain http://hellobabydirect.co.uk
  109. #ModPagespeedDomain www.hellobabydirect.co.uk
  110. ModPagespeedDomain http://hellobabydirect.disqus.com
  111. ModPagespeedMapOriginDomain http://scontent.cdninstagram.com https://scontent.cdninstagram.com
  112. ModPagespeedDomain http://netdna.bootstrapcdn.com
  113. ModPagespeedDomain http://fonts.googleapis.com
  114.  
  115. # This will allow resources found on http://cdn.myhost.com to be
  116. # rewritten in addition to those in the same domain as the HTML.
  117. #
  118. # Other domain-related directives (like ModPagespeedMapRewriteDomain
  119. # and ModPagespeedMapOriginDomain) can also authorize domains.
  120. #
  121. # Wildcards (* and ?) are allowed in the domain specification. Be
  122. # careful when using them as if you rewrite domains that do not
  123. # send you traffic, then the site receiving the traffic will not
  124. # know how to serve the rewritten content.
  125.  
  126. # If you use downstream caches such as varnish or proxy_cache for caching
  127. # HTML, you can configure pagespeed to work with these caches correctly
  128. # using the following directives. Note that the values for
  129. # ModPagespeedDownstreamCachePurgeLocationPrefix and
  130. # ModPagespeedDownstreamCacheRebeaconingKey are deliberately left empty here
  131. # in order to force the webmaster to choose appropriate value for these.
  132. #
  133. # ModPagespeedDownstreamCachePurgeLocationPrefix
  134. # ModPagespeedDownstreamCachePurgeMethod PURGE
  135. # ModPagespeedDownstreamCacheRewrittenPercentageThreshold 95
  136. # ModPagespeedDownstreamCacheRebeaconingKey
  137.  
  138. # Other defaults (cache sizes and thresholds):
  139. #
  140. ModPagespeedFileCacheSizeKb 2048000
  141. ModPagespeedFileCacheCleanIntervalMs 3600000
  142. ModPagespeedLRUCacheKbPerProcess 1024
  143. ModPagespeedLRUCacheByteLimit 16384
  144. # ModPagespeedCssFlattenMaxBytes 102400
  145. # ModPagespeedCssInlineMaxBytes 2048
  146. # ModPagespeedCssImageInlineMaxBytes 0
  147. # ModPagespeedImageInlineMaxBytes 3072
  148. # ModPagespeedJsInlineMaxBytes 2048
  149. # ModPagespeedCssOutlineMinBytes 3000
  150. # ModPagespeedJsOutlineMinBytes 3000
  151. ModPagespeedMaxCombinedCssBytes 250000
  152. ModPagespeedMaxCombinedJsBytes 250000
  153.  
  154. # Limit the number of inodes in the file cache. Set to 0 for no limit.
  155. # The default value if this paramater is not specified is 0 (no limit).
  156. ModPagespeedFileCacheInodeLimit 500000
  157.  
  158. # Bound the number of images that can be rewritten at any one time; this
  159. # avoids overloading the CPU. Set this to 0 to remove the bound.
  160. #
  161. # ModPagespeedImageMaxRewritesAtOnce 8
  162.  
  163. # You can also customize the number of threads per Apache process
  164. # mod_pagespeed will use to do resource optimization. Plain
  165. # "rewrite threads" are used to do short, latency-sensitive work,
  166. # while "expensive rewrite threads" are used for actual optimization
  167. # work that's more computationally expensive. If you live these unset,
  168. # or use values <= 0 the defaults will be used, which is 1 for both
  169. # values when using non-threaded MPMs (e.g. prefork) and 4 for both
  170. # on threaded MPMs (e.g. worker and event). These settings can only
  171. # be changed globally, and not per virtual host.
  172. #
  173. # ModPagespeedNumRewriteThreads 4
  174. # ModPagespeedNumExpensiveRewriteThreads 4
  175.  
  176. # Randomly drop rewrites (*) to increase the chance of optimizing
  177. # frequently fetched resources and decrease the chance of optimizing
  178. # infrequently fetched resources. This can reduce CPU load. The default
  179. # value of this parameter is 0 (no drops). 90 means that a resourced
  180. # fetched once has a 10% probability of being optimized while a resource
  181. # that is fetched 50 times has a 99.65% probability of being optimized.
  182. #
  183. # (*) Currently only CSS files and images are randomly dropped. Images
  184. # within CSS files are not randomly dropped.
  185. #
  186. # ModPagespeedRewriteRandomDropPercentage 90
  187.  
  188. # Many filters modify the URLs of resources in HTML files. This is typically
  189. # harmless but pages whose Javascript expects to read or modify the original
  190. # URLs may break. The following parameters prevent filters from modifying
  191. # URLs of their respective types.
  192. #
  193. # ModPagespeedJsPreserveURLs on
  194. # ModPagespeedImagePreserveURLs on
  195. # ModPagespeedCssPreserveURLs on
  196.  
  197. # When PreserveURLs is on, it is still possible to enable browser-specific
  198. # optimizations (for example, webp images can be served to browsers that
  199. # will accept them). They'll be served with Vary: Accept or Vary:
  200. # User-Agent headers as appropriate. Note that this may require configuring
  201. # reverse proxy caches such as varnish to handle these headers properly.
  202. #
  203. # ModPagespeedFilters in_place_optimize_for_browser
  204.  
  205. # Internet Explorer has difficulty caching resources with Vary: headers.
  206. # They will either be uncached (older IE) or require revalidation. See:
  207. # http://blogs.msdn.com/b/ieinternals/archive/2009/06/17/vary-header-prevents-caching-in-ie.aspx
  208. # As a result we serve them as Cache-Control: private instead by default.
  209. # If you are using a reverse proxy or CDN configured to cache content with
  210. # the Vary: Accept header you should turn this setting off.
  211. #
  212. # ModPagespeedPrivateNotVaryForIE on
  213.  
  214. # Settings for image optimization:
  215. #
  216. # Lossy image recompression quality (0 to 100, -1 just strips metadata):
  217. # ModPagespeedImageRecompressionQuality 85
  218. #
  219. # Jpeg recompression quality (0 to 100, -1 uses ImageRecompressionQuality):
  220. # ModPagespeedJpegRecompressionQuality -1
  221. # ModPagespeedJpegRecompressionQualityForSmallScreens 70
  222. #
  223. # WebP recompression quality (0 to 100, -1 uses ImageRecompressionQuality):
  224. # ModPagespeedWebpRecompressionQuality 80
  225. # ModPagespeedWebpRecompressionQualityForSmallScreens 70
  226. #
  227. # Timeout for conversions to WebP format, in
  228. # milliseconds. Negative values mean no timeout is applied. The
  229. # default value is -1:
  230. # ModPagespeedWebpTimeoutMs 5000
  231. #
  232. # Percent of original image size below which optimized images are retained:
  233. # ModPagespeedImageLimitOptimizedPercent 100
  234. #
  235. # Percent of original image area below which image resizing will be
  236. # attempted:
  237. # ModPagespeedImageLimitResizeAreaPercent 100
  238.  
  239. # Settings for inline preview images
  240. #
  241. # Setting this to n restricts preview images to the first n images found on
  242. # the page. The default of -1 means preview images can appear anywhere on
  243. # the page (if those images appear above the fold).
  244. # ModPagespeedMaxInlinedPreviewImagesIndex -1
  245.  
  246. # Sets the minimum size in bytes of any image for which a low quality image
  247. # is generated.
  248. # ModPagespeedMinImageSizeLowResolutionBytes 3072
  249.  
  250. # The maximum URL size is generally limited to about 2k characters
  251. # due to IE: See http://support.microsoft.com/kb/208427/EN-US.
  252. # Apache servers by default impose a further limitation of about
  253. # 250 characters per URL segment (text between slashes).
  254. # mod_pagespeed circumvents this limitation, but if you employ
  255. # proxy servers in your path you may need to re-impose it by
  256. # overriding the setting here. The default setting is 1024
  257. # characters.
  258. #
  259. # ModPagespeedMaxSegmentLength 250
  260.  
  261. # Uncomment this if you want to prevent mod_pagespeed from combining files
  262. # (e.g. CSS files) across paths
  263. #
  264. # ModPagespeedCombineAcrossPaths off
  265.  
  266. # Renaming JavaScript URLs can sometimes break them. With this
  267. # option enabled, mod_pagespeed uses a simple heuristic to decide
  268. # not to rename JavaScript that it thinks is introspective.
  269. #
  270. # You can uncomment this to let mod_pagespeed rename all JS files.
  271. #
  272. # ModPagespeedAvoidRenamingIntrospectiveJavascript off
  273.  
  274. # Certain common JavaScript libraries are available from Google, which acts
  275. # as a CDN and allows you to benefit from browser caching if a new visitor
  276. # to your site previously visited another site that makes use of the same
  277. # libraries as you do. Enable the following filter to turn on this feature.
  278. #
  279. # ModPagespeedEnableFilters canonicalize_javascript_libraries
  280.  
  281. # The following line configures a library that is recognized by
  282. # canonicalize_javascript_libraries. This will have no effect unless you
  283. # enable this filter (generally by uncommenting the last line in the
  284. # previous stanza). The format is:
  285. # ModPagespeedLibrary bytes md5 canonical_url
  286. # Where bytes and md5 are with respect to the *minified* JS; use
  287. # js_minify --print_size_and_hash to obtain this data.
  288. # Note that we can register multiple hashes for the same canonical url;
  289. # we do this if there are versions available that have already been minified
  290. # with more sophisticated tools.
  291. #
  292. # Additional library configuration can be found in
  293. # pagespeed_libraries.conf included in the distribution. You should add
  294. # new entries here, though, so that file can be automatically upgraded.
  295. # ModPagespeedLibrary 43 1o978_K0_LNE5_ystNklf http://www.modpagespeed.com/rewrite_javascript.js
  296.  
  297. # Explicitly tell mod_pagespeed to load some resources from disk.
  298. # This will speed up load time and update frequency.
  299. #
  300. # This should only be used for static resources which do not need
  301. # specific headers set or other processing by Apache.
  302. #
  303. # Both URL and filesystem path should specify directories and
  304. # filesystem path must be absolute (for now).
  305. #
  306. # ModPagespeedLoadFromFile "http://example.com/static/" "/var/www/static/"
  307.  
  308.  
  309. # Enables server-side instrumentation and statistics. If this rewriter is
  310. # enabled, then each rewritten HTML page will have instrumentation javacript
  311. # added that sends latency beacons to /mod_pagespeed_beacon. These
  312. # statistics can be accessed at /mod_pagespeed_statistics. You must also
  313. # enable the mod_pagespeed_statistics and mod_pagespeed_beacon handlers
  314. # below.
  315. #
  316. # ModPagespeedEnableFilters add_instrumentation
  317.  
  318. # The add_instrumentation filter sends a beacon after the page onload
  319. # handler is called. The user might navigate to a new URL before this. If
  320. # you enable the following directive, the beacon is sent as part of an
  321. # onbeforeunload handler, for pages where navigation happens before the
  322. # onload event.
  323. #
  324. # ModPagespeedReportUnloadTime on
  325.  
  326. # Uncomment the following line so that ModPagespeed will not cache or
  327. # rewrite resources with Vary: in the header, e.g. Vary: User-Agent.
  328. # Note that ModPagespeed always respects Vary: headers on html content.
  329. # ModPagespeedRespectVary on
  330.  
  331. # Uncomment the following line if you want to disable statistics entirely.
  332. #
  333. # ModPagespeedStatistics off
  334.  
  335. # These handlers are central entry-points into the admin pages.
  336. # By default, pagespeed_admin and pagespeed_global_admin present
  337. # the same data, and differ only when
  338. # ModPagespeedUsePerVHostStatistics is enabled. In that case,
  339. # /pagespeed_global_admin sees aggregated data across all vhosts,
  340. # and the /pagespeed_admin sees data only for a particular vhost.
  341. #
  342. # You may insert other "Allow from" lines to add hosts you want to
  343. # allow to look at generated statistics. Another possibility is
  344. # to comment out the "Order" and "Allow" options from the config
  345. # file, to allow any client that can reach your server to access
  346. # and change server state, such as statistics, caches, and
  347. # messages. This might be appropriate in an experimental setup.
  348. <Location /pagespeed_admin>
  349. Order allow,deny
  350. Allow from localhost
  351. Allow from 127.0.0.1
  352. SetHandler pagespeed_admin
  353. </Location>
  354. <Location /pagespeed_global_admin>
  355. Order allow,deny
  356. Allow from localhost
  357. Allow from 127.0.0.1
  358. SetHandler pagespeed_global_admin
  359. </Location>
  360.  
  361. # Enable logging of mod_pagespeed statistics, needed for the console.
  362. ModPagespeedStatisticsLogging on
  363.  
  364. # Page /mod_pagespeed_message lets you view the latest messages from
  365. # mod_pagespeed, regardless of log-level in your httpd.conf
  366. # ModPagespeedMessageBufferSize is the maximum number of bytes you would
  367. # like to dump to your /mod_pagespeed_message page at one time,
  368. # its default value is 100k bytes.
  369. # Set it to 0 if you want to disable this feature.
  370. ModPagespeedMessageBufferSize 100000
  371. </IfModule>
  372.  
  373. ModPagespeedStatistics on
  374. ModPagespeedStatisticsLogging on
  375. ModPagespeedLogDir /var/log/pagespeed
  376. <Location /pagespeed_admin>
  377. Order allow,deny
  378. Allow from localhost
  379. Allow from 127.0.0.1
  380. SetHandler pagespeed_admin
  381. </Location>
  382.  
  383. ModPagespeedFetchHttps enable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement