rewrite JavaScript not working

400 views
Skip to first unread message

DB Digital IT Helpdesk

unread,
Apr 25, 2017, 1:03:20 AM4/25/17
to mod-pagespeed-discuss, nlttest -, IMCL IT (NOC)
Dear Team,

We are facing one issue pagespeed is not able to rewrite javascript.

Please help me solving this.
You can chek in this :-

some contents of view source :- 
<link rel="canonical" href="http://www.bhaskar.com/"/> <meta name="google" content="notranslate"/> <script type="text/psajs" orig_index="15">var mmaxkey='';var mmaxval='';var APPFEED_DOMAIN='https://appfeedlight.bhaskar.com/';</script> <script rel='preconnect' src="/bhaskar-serviceworker-install.js?v8" pagespeed_no_defer="" defer></script><!--Uncacheable content, preventing rewriting of https://m.bhaskar.com/bhaskar-serviceworker-install.js?v8--> <script rel='preconnect' src="/public/nbhaskarpwa/js/jquery.min.js?v21" pagespeed_no_defer="" defer></script><!--Uncacheable content, preventing rewriting of https://m.bhaskar.com/public/nbhaskarpwa/js/jquery.min.js?v21--> <script rel='preconnect' src="/public/nbhaskarpwa/js/custom_data_v2.js?p87" pagespeed_no_defer="" defer></script><!--Uncacheable content, preventing rewriting of https://m.bhaskar.com/public/nbhaskarpwa/js/custom_data_v2.js?p87--> <script data-pagespeed-no-defer>//<![CDATA[




Krishna

Otto van der Schaaf

unread,
Apr 25, 2017, 2:34:56 AM4/25/17
to mod-pagespeed-discuss, nlttest -, IMCL IT (NOC)
These js files are served with an Expires: header that indicates they expire right away.
mod_pagespeed will not rewrite uncacheable resources.

Otto


The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee or addressee's. If you are not an intended recipient, please delete the message and any attachments and notify the sender of nondelivery. Any use or disclosure of the contents of either is unauthorised and may be unlawful. All liability for viruses is excluded to the fullest extent permitted by law. Any views expressed in this message are those of the individual sender, except where the sender states them, with requisite authority, to be those of the organisation.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/0d5e4c3c-3819-4b0f-90f6-0386ab8dd3fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

IMCL NOC

unread,
Apr 25, 2017, 2:38:36 AM4/25/17
to Otto van der Schaaf, mod-pagespeed-discuss, nlttest -
Hi Otto,
Thanks for quick reply.

what i need to check for this.

below what is added in our httpd.conf
any change please suggest 


#################
Header unset Cache-Control
Header unset Pragma
Header set Cache-Control "max-age=7200, must-revalidate"
FileETag none
ExpiresActive On
ExpiresDefault "access plus 3000000 seconds"
ExpiresByType text/html "access plus 10 day"
ExpiresByType text/css "access plus 10 day"
ExpiresByType text/javascript "access plus 10 day"
ExpiresByType image/gif "access plus 10 day"
ExpiresByType image/jpg "access plus 10 day"
ExpiresByType image/jpeg "access plus 10 day"
ExpiresByType image/png "access plus 10 day"
#############################

Krishna

To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

Joshua Marantz

unread,
Apr 25, 2017, 9:03:27 AM4/25/17
to mod-pagespeed-discuss, Otto van der Schaaf, nlttest -
I'd suggest changing:
  Header set Cache-Control "max-age=7200, must-revalidate"
to
  Header set Cache-Control "max-age=7200"
or even
  Header set Cache-Control "max-age=600"

PageSpeed doesn't have a good operational story for origin resource revalidation on every request.  That would really slow down the delivery of HTML.  So it's fine to reduce the cache lifetime a bit to avoid stale content.

Alternatively, you can leave the revalidation in, but use ModPagespeedLoadFromFile so MPS can bypass the HTTP semantics and will check the file modification-time on every access, which is OK if your files are stored on a local physical disk. I do *not* recommend LoadFromFile if your files are on a network share.


To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.

DB Digital IT Helpdesk

unread,
Apr 30, 2017, 2:44:58 AM4/30/17
to mod-pagesp...@googlegroups.com, Otto van der Schaaf, nlttest -
Dear Team,

we tried adding Header set Cache-Control "max-age=600"
still its not getting optimized by mod-pagespeed.

Krishna

IT Helpdesk Team,
Technology/NOC 

DB Corp. Ltd. – Digital Business
Mumbai
Direct : 09920591252

 



--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/N7GIYbCTXHE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAGKR%2BEDVXReq3PO68%2BYdJ5WgzTUhGgxV8oZsKXbMeN27irmpcQ%40mail.gmail.com.

For more options, visit https://groups.google.com/d/optout.

DB Digital IT Helpdesk

unread,
May 1, 2017, 7:16:52 AM5/1/17
to mod-pagesp...@googlegroups.com, Otto van der Schaaf, nlttest -
Dear Team,

Please help its not working

Origin server is http only & ssl certificate is installed at LB is this has any thing to do in this.


Inline image 1


Also added this 

<FilesMatch "\.(jpg|jpeg|gif|png|js|css)$">
    Header set Cache-control "public, max-age=86400"
</FilesMatch>



Krishna

IT Helpdesk Team,
Technology/NOC 

DB Corp. Ltd. – Digital Business
Mumbai
Direct : 09920591252

 


On Sun, Apr 30, 2017 at 12:14 PM, DB Digital IT Helpdesk <ithel...@dainikbhaskar.com> wrote:
Dear Team,

To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.

Joshua Marantz

unread,
May 1, 2017, 8:32:57 AM5/1/17
to mod-pagespeed-discuss, nlttest -, Otto van der Schaaf
Hi....I glanced at your html earlier and I saw some preconnect hints for scripts where there want a corresponding <script src=> in the markup.  Is that because you are dynamically loadng some of the JavaScript files?  

I think that will not work properly with url-renaming and you should consider using JsPreserveUrls.  You will still get js minification, but will not be able to extend cache lifetime.



To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAOc1FPaAurKTcs-iLSoXJtW2zv4Z1-_%3DCR4G738gEbo-dd%3DZ0w%40mail.gmail.com.

DB Digital IT Helpdesk

unread,
May 1, 2017, 9:42:19 AM5/1/17
to mod-pagesp...@googlegroups.com, nlttest -, Otto van der Schaaf
Hi Can you give me syntax for apache so that i can add this filter

for :- 

JsPreserveURLs

Krishna

--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/N7GIYbCTXHE/unsubscribe.

For more options, visit https://groups.google.com/d/optout.

Joshua Marantz

unread,
May 1, 2017, 9:53:42 AM5/1/17
to mod-pagespeed-discuss, nlttest -, Otto van der Schaaf


ModPagespeedJsPreserveURLs on



To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.




The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee or addressee's. If you are not an intended recipient, please delete the message and any attachments and notify the sender of nondelivery. Any use or disclosure of the contents of either is unauthorised and may be unlawful. All liability for viruses is excluded to the fullest extent permitted by law. Any views expressed in this message are those of the individual sender, except where the sender states them, with requisite authority, to be those of the organisation.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAOc1FPZoVVJqB5-%3DUppCJnB9dW2P_AXWUkAGF37A_qMnnMnVhQ%40mail.gmail.com.

DB Digital IT Helpdesk

unread,
May 1, 2017, 11:19:58 AM5/1/17
to mod-pagesp...@googlegroups.com, nlttest -, Otto van der Schaaf
Still it's not working 



Krishna

--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/N7GIYbCTXHE/unsubscribe.

For more options, visit https://groups.google.com/d/optout.

Joshua Marantz

unread,
May 1, 2017, 11:23:52 AM5/1/17
to mod-pagespeed-discuss
Can you share the URL of a JavaScript file on your site that is not being minified, along with your pagespeed.conf?

Thanks!


To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.




The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee or addressee's. If you are not an intended recipient, please delete the message and any attachments and notify the sender of nondelivery. Any use or disclosure of the contents of either is unauthorised and may be unlawful. All liability for viruses is excluded to the fullest extent permitted by law. Any views expressed in this message are those of the individual sender, except where the sender states them, with requisite authority, to be those of the organisation.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAOc1FPYbmRM1K_U%3DBnNGDfkC4KTC3Jy%3DR7fGpKbrMEjE6EV%2Bhw%40mail.gmail.com.

DB Digital IT Helpdesk

unread,
May 1, 2017, 11:48:27 AM5/1/17
to mod-pagesp...@googlegroups.com
Hi, below is all details.

My website flow is

Akamai-ssl installed ----> sucuri waf -ssl installed ----> Load Balancer -ssl installed ----> 9 Origin servers with http (80) & modpagespeed

Some filters are on from httpd.conf
#############################################
ModPagespeedSupportNoScriptEnabled false ModPagespeedDomain https://m.bhaskar.com ModPagespeedMapOriginDomain http://localhost https://m.bhaskar.com #ModPagespeedFetchHttps enable #ModPagespeedRespectXForwardedProto on #ModPagespeedDisableFilters rewrite_javascript_external ModPagespeedDisableFilters move_css_to_head ModPagespeedLazyloadImagesAfterOnload off ModPagespeedFileCachePath "/pspeed_cache/mbhaskar-updated/" ModPagespeedFileCacheSizeKb 1024000 ModPagespeedFileCacheCleanIntervalMs 7200000 ModPagespeedDisallow http*://pagead2.googlesyndication.com/* ModPagespeedDisallow http*://securepubads.g.doubleclick.net/* #ModPagespeedDisallow */news/JM-* #ModPagespeedDisallow */news-*/JM-*
###########################################

############################################
############################################

##############################################
Js Url That are not rewriten :-
https://m.bhaskar.com/bhaskar-serviceworker-install.js?v8


##############################################

#############################################
Pagespeed.conf :-


###########Attempt to load mod_version if it wasn't loaded or compiled in (eg on Debian) <IfModule !mod_version.c> LoadModule version_module /usr/lib64/httpd/modules/mod_version.so </IfModule> <IfVersion < 2.4> LoadModule pagespeed_module /usr/lib64/httpd/modules/mod_pagespeed.so </IfVersion> <IfVersion >= 2.4.2> LoadModule pagespeed_module /usr/lib64/httpd/modules/mod_pagespeed_ap24.so </IfVersion> # Only attempt to load mod_deflate if it hasn't been loaded already. <IfModule !mod_deflate.c> LoadModule deflate_module /usr/lib64/httpd/modules/mod_deflate.so </IfModule> <IfModule pagespeed_module> # Turn on mod_pagespeed. To completely disable mod_pagespeed, you # can set this to "off". ModPagespeed on # We want VHosts to inherit global configuration. # If this is not included, they'll be independent (except for inherently # global options), at least for backwards compatibility. ModPagespeedInheritVHostConfig on
# Direct Apache to send all HTML output to the mod_pagespeed # output handler. AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html # If you want mod_pagespeed process XHTML as well, please uncomment this # line. # AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER application/xhtml+xml # The ModPagespeedFileCachePath directory must exist and be writable # by the apache user (as specified by the User directive). ModPagespeedFileCachePath "/var/cache/mod_pagespeed/" # ModPagespeedFileCachePath "/disk2/cache/mod_pagespeed/" # LogDir is needed to store various logs, including the statistics log # required for the console. ModPagespeedLogDir "/var/log/pagespeed" #ModPagespeedLogDir "/disk2/log/pagespeed" # The locations of SSL Certificates is distribution-dependent. ModPagespeedSslCertDirectory "/etc/pki/tls/certs" ModPagespeedSslCertFile /etc/pki/tls/cert.pem # If you want, you can use one or more memcached servers as the store for # the mod_pagespeed cache. # ModPagespeedMemcachedServers localhost:11211 # A portion of the cache can be kept in memory only, to reduce load on disk # (or memcached) from many small files. # ModPagespeedCreateSharedMemoryMetadataCache "/var/cache/mod_pagespeed/" 51200 ModPagespeedCreateSharedMemoryMetadataCache "/disk2/cache/mod_pagespeed/" 51200 # Override the mod_pagespeed 'rewrite level'. The default level # "CoreFilters" uses a set of rewrite filters that are generally # safe for most web pages. Most sites should not need to change # this value and can instead fine-tune the configuration using the # ModPagespeedDisableFilters and ModPagespeedEnableFilters # directives, below. Valid values for ModPagespeedRewriteLevel are # PassThrough, CoreFilters and TestingCoreFilters. #
ModPagespeedRewriteLevel PassThrough # Explicitly disables specific filters. This is useful in # conjuction with ModPagespeedRewriteLevel. For instance, if one # of the filters in the CoreFilters needs to be disabled for a # site, that filter can be added to # ModPagespeedDisableFilters. This directive contains a # comma-separated list of filter names, and can be repeated. # # ModPagespeedDisableFilters rewrite_images # Explicitly enables specific filters. This is useful in # conjuction with ModPagespeedRewriteLevel. For instance, filters # not included in the CoreFilters may be enabled using this # directive. This directive contains a comma-separated list of # filter names, and can be repeated. # # ModPagespeedEnableFilters rewrite_javascript,rewrite_css # ModPagespeedEnableFilters collapse_whitespace,elide_attributes # ModPagespeedEnableFilters collapse_whitespace # Explicitly forbids the enabling of specific filters using either query # parameters or request headers. This is useful, for example, when we do # not want the filter to run for performance or security reasons. This # directive contains a comma-separated list of filter names, and can be # repeated. # # ModPagespeedForbidFilters rewrite_images # How long mod_pagespeed will wait to return an optimized resource # (per flush window) on first request before giving up and returning the # original (unoptimized) resource. After this deadline is exceeded the # original resource is returned and the optimization is pushed to the # background to be completed for future requests. Increasing this value will # increase page latency, but might reduce load time (for instance on a # bandwidth-constrained link where it's worth waiting for image # compression to complete). If the value is less than or equal to zero # mod_pagespeed will wait indefinitely for the rewrite to complete before # returning. # # ModPagespeedRewriteDeadlinePerFlushMs 10 # ModPagespeedDomain # authorizes rewriting of JS, CSS, and Image files found in this # domain. By default only resources with the same origin as the # HTML file are rewritten. For example: #
# ModPagespeedDomain cdn.myhost.com ModPagespeedDisallow "http://central.bhaskar.com/*" ModPagespeedDisallow "http*://pagead2.googlesyndication.com/*" ModPagespeedDisallow "http*://securepubads.g.doubleclick.net/*" ModPagespeedDisallow "http*://tpc.googlesyndication.com/*" ModPagespeedDisallow "http*://partner.googleadservices.com/*" ModPagespeedDisallow "http*://*cloudfront.net/*" ModPagespeedDomain *.bhaskar.com ## ModPagespeedDomain *.google.com ## ModPagespeedDomain *.dainikbhaskar.in ## ModPagespeedDomain *.googlesyndication.com ## ModPagespeedDomain *.gstatic.com # # This will allow resources found on http://cdn.myhost.com to be # rewritten in addition to those in the same domain as the HTML. # # Other domain-related directives (like ModPagespeedMapRewriteDomain # and ModPagespeedMapOriginDomain) can also authorize domains. # # Wildcards (* and ?) are allowed in the domain specification. Be # careful when using them as if you rewrite domains that do not # send you traffic, then the site receiving the traffic will not # know how to serve the rewritten content. # If you use downstream caches such as varnish or proxy_cache for caching # HTML, you can configure pagespeed to work with these caches correctly # using the following directives. Note that the values for # ModPagespeedDownstreamCachePurgeLocationPrefix and # ModPagespeedDownstreamCacheRebeaconingKey are deliberately left empty here # in order to force the webmaster to choose appropriate value for these. # # ModPagespeedDownstreamCachePurgeLocationPrefix # ModPagespeedDownstreamCachePurgeMethod PURGE # ModPagespeedDownstreamCacheRewrittenPercentageThreshold 95 # ModPagespeedDownstreamCacheRebeaconingKey # Other defaults (cache sizes and thresholds): # # ModPagespeedFileCacheSizeKb 102400 ModPagespeedFileCacheSizeKb 512000 # ModPagespeedFileCacheCleanIntervalMs 3600000 ModPagespeedFileCacheCleanIntervalMs 7200000 ModPagespeedLRUCacheKbPerProcess 1024 ModPagespeedLRUCacheByteLimit 16384
# ModPagespeedCssFlattenMaxBytes 102400 # ModPagespeedCssInlineMaxBytes 2048 # ModPagespeedCssImageInlineMaxBytes 0 # ModPagespeedImageInlineMaxBytes 3072 # ModPagespeedJsInlineMaxBytes 2048 # ModPagespeedCssOutlineMinBytes 3000 # ModPagespeedJsOutlineMinBytes 3000 # ModPagespeedMaxCombinedCssBytes MaxBytes # ModPagespeedMaxCombinedJsBytes 92160 # Limit the number of inodes in the file cache. Set to 0 for no limit. # The default value if this paramater is not specified is 0 (no limit). ModPagespeedFileCacheInodeLimit 500000 # Bound the number of images that can be rewritten at any one time; this # avoids overloading the CPU. Set this to 0 to remove the bound. # # ModPagespeedImageMaxRewritesAtOnce 8 # You can also customize the number of threads per Apache process # mod_pagespeed will use to do resource optimization. Plain # "rewrite threads" are used to do short, latency-sensitive work, # while "expensive rewrite threads" are used for actual optimization # work that's more computationally expensive. If you live these unset, # or use values <= 0 the defaults will be used, which is 1 for both # values when using non-threaded MPMs (e.g. prefork) and 4 for both # on threaded MPMs (e.g. worker and event). These settings can only # be changed globally, and not per virtual host. # # ModPagespeedNumRewriteThreads 4 # ModPagespeedNumExpensiveRewriteThreads 4 # Randomly drop rewrites (*) to increase the chance of optimizing # frequently fetched resources and decrease the chance of optimizing # infrequently fetched resources. This can reduce CPU load. The default # value of this parameter is 0 (no drops). 90 means that a resourced # fetched once has a 10% probability of being optimized while a resource # that is fetched 50 times has a 99.65% probability of being optimized. # # (*) Currently only CSS files and images are randomly dropped. Images # within CSS files are not randomly dropped. # # ModPagespeedRewriteRandomDropPercentage 90 # Many filters modify the URLs of resources in HTML files. This is typically # harmless but pages whose Javascript expects to read or modify the original # URLs may break. The following parameters prevent filters from modifying # URLs of their respective types.
# ModPagespeedJsPreserveURLs on # ModPagespeedImagePreserveURLs on # ModPagespeedCssPreserveURLs on # When PreserveURLs is on, it is still possible to enable browser-specific # optimizations (for example, webp images can be served to browsers that # will accept them). They'll be served with Vary: Accept or Vary: # User-Agent headers as appropriate. Note that this may require configuring # reverse proxy caches such as varnish to handle these headers properly. # # ModPagespeedFilters in_place_optimize_for_browser # Internet Explorer has difficulty caching resources with Vary: headers. # They will either be uncached (older IE) or require revalidation. See: # http://blogs.msdn.com/b/ieinternals/archive/2009/06/17/vary-header-prevents-caching-in-ie.aspx # As a result we serve them as Cache-Control: private instead by default. # If you are using a reverse proxy or CDN configured to cache content with # the Vary: Accept header you should turn this setting off. # # ModPagespeedPrivateNotVaryForIE on # Settings for image optimization: # # Lossy image recompression quality (0 to 100, -1 just strips metadata): # ModPagespeedImageRecompressionQuality 85 # # Jpeg recompression quality (0 to 100, -1 uses ImageRecompressionQuality): # ModPagespeedJpegRecompressionQuality -1 # ModPagespeedJpegRecompressionQualityForSmallScreens 70 # # WebP recompression quality (0 to 100, -1 uses ImageRecompressionQuality): # ModPagespeedWebpRecompressionQuality 80 # ModPagespeedWebpRecompressionQualityForSmallScreens 70 # # Timeout for conversions to WebP format, in # milliseconds. Negative values mean no timeout is applied. The # default value is -1: # ModPagespeedWebpTimeoutMs 5000 # # Percent of original image size below which optimized images are retained: # ModPagespeedImageLimitOptimizedPercent 100 # # Percent of original image area below which image resizing will be # attempted: # ModPagespeedImageLimitResizeAreaPercent 100 # Settings for inline preview images # # Setting this to n restricts preview images to the first n images found on # the page. The default of -1 means preview images can appear anywhere on # the page (if those images appear above the fold).
# ModPagespeedMaxInlinedPreviewImagesIndex -1 # Sets the minimum size in bytes of any image for which a low quality image # is generated. # ModPagespeedMinImageSizeLowResolutionBytes 3072 # The maximum URL size is generally limited to about 2k characters # due to IE: See http://support.microsoft.com/kb/208427/EN-US. # Apache servers by default impose a further limitation of about # 250 characters per URL segment (text between slashes). # mod_pagespeed circumvents this limitation, but if you employ # proxy servers in your path you may need to re-impose it by # overriding the setting here. The default setting is 1024 # characters. # # ModPagespeedMaxSegmentLength 250 # Uncomment this if you want to prevent mod_pagespeed from combining files # (e.g. CSS files) across paths # # ModPagespeedCombineAcrossPaths off # Renaming JavaScript URLs can sometimes break them. With this # option enabled, mod_pagespeed uses a simple heuristic to decide # not to rename JavaScript that it thinks is introspective. # # You can uncomment this to let mod_pagespeed rename all JS files. # # ModPagespeedAvoidRenamingIntrospectiveJavascript off # Certain common JavaScript libraries are available from Google, which acts # as a CDN and allows you to benefit from browser caching if a new visitor # to your site previously visited another site that makes use of the same # libraries as you do. Enable the following filter to turn on this feature. # # ModPagespeedEnableFilters canonicalize_javascript_libraries # The following line configures a library that is recognized by # canonicalize_javascript_libraries. This will have no effect unless you # enable this filter (generally by uncommenting the last line in the # previous stanza). The format is: # ModPagespeedLibrary bytes md5 canonical_url # Where bytes and md5 are with respect to the *minified* JS; use # js_minify --print_size_and_hash to obtain this data. # Note that we can register multiple hashes for the same canonical url; # we do this if there are versions available that have already been minified # with more sophisticated tools. # # Additional library configuration can be found in # pagespeed_libraries.conf included in the distribution. You should add # new entries here, though, so that file can be automatically upgraded. # ModPagespeedLibrary 43 1o978_K0_LNE5_ystNklf http://www.modpagespeed.com/rewrite_javascript.js
# Explicitly tell mod_pagespeed to load some resources from disk. # This will speed up load time and update frequency. # # This should only be used for static resources which do not need # specific headers set or other processing by Apache. # # Both URL and filesystem path should specify directories and # filesystem path must be absolute (for now). # # ModPagespeedLoadFromFile "http://example.com/static/" "/var/www/static/" # Enables server-side instrumentation and statistics. If this rewriter is # enabled, then each rewritten HTML page will have instrumentation javacript # added that sends latency beacons to /mod_pagespeed_beacon. These # statistics can be accessed at /mod_pagespeed_statistics. You must also # enable the mod_pagespeed_statistics and mod_pagespeed_beacon handlers # below. # # ModPagespeedEnableFilters add_instrumentation # The add_instrumentation filter sends a beacon after the page onload # handler is called. The user might navigate to a new URL before this. If # you enable the following directive, the beacon is sent as part of an # onbeforeunload handler, for pages where navigation happens before the # onload event. # # ModPagespeedReportUnloadTime on # Uncomment the following line so that ModPagespeed will not cache or # rewrite resources with Vary: in the header, e.g. Vary: User-Agent. # Note that ModPagespeed always respects Vary: headers on html content. # ModPagespeedRespectVary on # Uncomment the following line if you want to disable statistics entirely. # # ModPagespeedStatistics off ModPagespeedStatistics on # These handlers are central entry-points into the admin pages. # By default, pagespeed_admin and pagespeed_global_admin present # the same data, and differ only when # ModPagespeedUsePerVHostStatistics is enabled. In that case, # /pagespeed_global_admin sees aggregated data across all vhosts, # and the /pagespeed_admin sees data only for a particular vhost. # # You may insert other "Allow from" lines to add hosts you want to # allow to look at generated statistics. Another possibility is # to comment out the "Order" and "Allow" options from the config # file, to allow any client that can reach your server to access # and change server state, such as statistics, caches, and # messages. This might be appropriate in an experimental setup.
<Location /pagespeed_admin> Order allow,deny Allow from localhost Allow from 127.0.0.1 #Allow from 192.168.1.0/24 Allow from All SetHandler pagespeed_admin </Location> <Location /pagespeed_global_admin> Order allow,deny Allow from localhost Allow from 127.0.0.1 Allow from 192.168.1.0/24 Allow from All SetHandler pagespeed_global_admin </Location> # Enable logging of mod_pagespeed statistics, needed for the console. ModPagespeedStatisticsLogging on # Page /mod_pagespeed_message lets you view the latest messages from # mod_pagespeed, regardless of log-level in your httpd.conf # ModPagespeedMessageBufferSize is the maximum number of bytes you would # like to dump to your /mod_pagespeed_message page at one time, # its default value is 100k bytes. # Set it to 0 if you want to disable this feature. ModPagespeedMessageBufferSize 100000 ################ Filters added by us ############# #ModPagespeedEnableFilters prioritize_critical_css ##ModPagespeedEnableFilters defer_javascript ##ModPagespeedEnableFilters elide_attributes #ModPagespeedEnableFilters sprite_images ##ModPagespeedEnableFilters collapse_whitespace,remove_comments ##ModPagespeedEnableFilters dedup_inlined_images ##ModPagespeedForceCaching on #ModPagespeedEnableFilters combine_css #ModPagespeedEnableFilters inline_images #ModPagespeedEnableFilters dedup_inlined_images #ModPagespeedEnableFilters inline_preview_images #ModPagespeedEnableFilters resize_mobile_images #ModPagespeedEnableFilters insert_image_dimensions #ModPagespeedEnableFilters rewrite_images
#ModPagespeedImageRecompressionQuality -1 #ModPagespeedEnableFilters recompress_jpeg #ModPagespeedEnableFilters convert_jpeg_to_progressive #ModPagespeedEnableFilters recompress_png #ModPagespeedEnableFilters convert_png_to_jpeg #ModPagespeedEnableFilters canonicalize_javascript_libraries #ModPagespeedEnableFilters combine_css #ModPagespeedEnableCachePurge on ################################### ###################nathan ModPagespeedEnableFilters insert_dns_prefetch ModPagespeedEnableFilters collapse_whitespace ModPagespeedEnableFilters rewrite_javascript ModPagespeedEnableFilters defer_javascript ModPagespeedEnableFilters move_css_above_scripts ModPagespeedEnableFilters move_css_to_head #ModPagespeedEnableFilters rewrite_images #ModPagespeedEnableFilters recompress_images #ModPagespeedEnableFilters convert_jpeg_to_webp #ModPagespeedEnableFilters convert_to_webp_lossless ModPagespeedEnableFilters lazyload_images #ModPagespeedEnableFilters inline_preview_images #ModPagespeedMaxInlinedPreviewImagesIndex -1 #ModPagespeedMinImageSizeLowResolutionBytes 1 ModPagespeedCriticalImagesBeaconEnabled false ModPagespeedEnableFilters elide_attributes #ModPagespeedEnableFilters prioritize_critical_css ModPagespeedRateLimitBackgroundFetches off ModPagespeedEnableFilters fallback_rewrite_css_urls #ModPagespeedEnableFilters extend_cache ModPagespeedEnableCachePurge on #ModPagespeedEnableFilters inline_css #ModPagespeedCssInlineMaxBytes 200 ################ </IfModule>


#################################################


Krishna

--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/N7GIYbCTXHE/unsubscribe.

For more options, visit https://groups.google.com/d/optout.

Joshua Marantz

unread,
May 1, 2017, 12:34:50 PM5/1/17
to mod-pagespeed-discuss
Thanks for the config.  Can you also share the URL of a JavaScript file on your site that is not being minified?

To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.




The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee or addressee's. If you are not an intended recipient, please delete the message and any attachments and notify the sender of nondelivery. Any use or disclosure of the contents of either is unauthorised and may be unlawful. All liability for viruses is excluded to the fullest extent permitted by law. Any views expressed in this message are those of the individual sender, except where the sender states them, with requisite authority, to be those of the organisation.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAOc1FPaVNOxV%2BB%3DfZtMaOc3UP5YA_%3D2iw1W0vH2HfM%2B-%2BcGCZg%40mail.gmail.com.

DB Digital IT Helpdesk

unread,
May 2, 2017, 6:13:05 AM5/2/17
to mod-pagesp...@googlegroups.com
Same is their in last mail.
Krishna

--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/N7GIYbCTXHE/unsubscribe.

For more options, visit https://groups.google.com/d/optout.

Joshua Marantz

unread,
May 2, 2017, 7:26:12 AM5/2/17
to mod-pagespeed-discuss
I see this in your rewritten HTML:

<script rel='preconnect' src="/bhaskar-serviceworker-install.js,qv8.pagespeed.jm.Nuy4u2dSRA.js" pagespeed_no_defer="" defer></script>

And when I then visit that JS file, it is minified properly.  However I see that in the waterfall in Chrome, bhaskar-serviceworker-install.js?v8 is being fetched, rather than the above version.  I'm wondering if it's related to the preconnect attribute.  Looking at https://w3c.github.io/resource-hints/ I don't think you are using preconnect correctly.  That should be a link tag:
  <link rel="preconnect" src="/bhaskar-serviceworker-install.js" />
rather than a script tag.

I think PageSpeed is ignoring the rel=preconnect because it is not looking for "rel" on a script tag, and is optimizing the URL even though it will be ignored by Chrome.

So how is the script getting loaded at all?  I'm thinking it must be loaded dynamically by some other JavaScript.  If it was being loaded directly from that script tag (ignoring the preconnect) then I would think it would be loaded by Chrome from that URL.

The other thing you can do is turn on InPlaceResourceOptimization.  Then PageSpeed will be able to optimize assets loaded dynamically, that can't be found by statically scanning HTML and CSS.

-Josh



To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.




The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee or addressee's. If you are not an intended recipient, please delete the message and any attachments and notify the sender of nondelivery. Any use or disclosure of the contents of either is unauthorised and may be unlawful. All liability for viruses is excluded to the fullest extent permitted by law. Any views expressed in this message are those of the individual sender, except where the sender states them, with requisite authority, to be those of the organisation.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAOc1FPaPiXz_8OGYTkZzFauz%3DEPj3dz-TG%3D4Li2S1WgjSE5uXw%40mail.gmail.com.

DB Digital IT Helpdesk

unread,
May 2, 2017, 8:27:26 AM5/2/17
to mod-pagesp...@googlegroups.com
Thanks for the observation.

But i can not see any js script optimized via pagspeed it might be cached in some testings.

I will ask my development to look in to this as per your suggestion on script tag.

Will revert you on this soon.

Krishna

--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/N7GIYbCTXHE/unsubscribe.

For more options, visit https://groups.google.com/d/optout.

Joshua Marantz

unread,
May 2, 2017, 8:32:28 AM5/2/17
to mod-pagespeed-discuss
I found the script tag pasted above with View->Source in Chrome.  Visiting that script (https://m.bhaskar.com/bhaskar-serviceworker-install.js,qv8.pagespeed.jm.Nuy4u2dSRA.js) I see this:
if('serviceWorker'in navigator){navigator.serviceWorker.register('/public/nbhaskarpwa/bhaskar-service-worker-pwa-v1.js?v11',{scope:'/public/nbhaskarpwa/'}).then(function(registration){console.log("Service Worker Registered");}).catch(function(err){console.log("Service Worker Failed to Register",err);})}
The original, unminified form, found at https://m.bhaskar.com/bhaskar-serviceworker-install.js?v8 is this:
if ('serviceWorker' in navigator) {
    navigator.serviceWorker
    .register('/public/nbhaskarpwa/bhaskar-service-worker-pwa-v1.js?v11', { scope: '/public/nbhaskarpwa/' })
    .then(function(registration) {
      console.log("Service Worker Registered");
    })
    .catch(function(err) {
      console.log("Service Worker Failed to Register", err);
    })

}
So I think that rewrite_javascript is working on your site, at least in that case.



To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.




The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee or addressee's. If you are not an intended recipient, please delete the message and any attachments and notify the sender of nondelivery. Any use or disclosure of the contents of either is unauthorised and may be unlawful. All liability for viruses is excluded to the fullest extent permitted by law. Any views expressed in this message are those of the individual sender, except where the sender states them, with requisite authority, to be those of the organisation.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAOc1FPY3aWkYxXhr%3DCj3NxQRJTrUEO9EnSApBiSQrd2PqM-d9A%40mail.gmail.com.

DB Digital IT Helpdesk

unread,
May 2, 2017, 9:06:41 AM5/2/17
to mod-pagesp...@googlegroups.com
To me its not showing any thing on live site you can see the debug below

Inline image 1

Also what is issue with other two js scripts.

Krishna



--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/N7GIYbCTXHE/unsubscribe.

For more options, visit https://groups.google.com/d/optout.

Joshua Marantz

unread,
May 2, 2017, 9:11:47 AM5/2/17
to mod-pagespeed-discuss
Probably you need to refresh the browser because the optimized serviceworker js fell out of cache. It just showed up for me when I visited



You mentioned something earlier about caching.  Do you have some kind of cache other than PageSpeed?  Depending on configuration, that can definitely affect optimization.


To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.




The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee or addressee's. If you are not an intended recipient, please delete the message and any attachments and notify the sender of nondelivery. Any use or disclosure of the contents of either is unauthorised and may be unlawful. All liability for viruses is excluded to the fullest extent permitted by law. Any views expressed in this message are those of the individual sender, except where the sender states them, with requisite authority, to be those of the organisation.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAOc1FPYpfh8-VFacBBbLhfrxWrbtUwC7AFr1%3Da4NoAqSGvBrmA%40mail.gmail.com.

DB Digital IT Helpdesk

unread,
May 2, 2017, 11:37:29 AM5/2/17
to mod-pagesp...@googlegroups.com
Hi Team thanks,


Yes we user akamai for caching

it was working good before do what happen & it stopped working.

I tried many changes but no luck 

same is working for other site m.divyabhaskar.co.in  & not working for m.bhaskar.com hosted on same origin server filters are also same 

If you found any thing that can cause this please tell me.



Krishna







Krishna

--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/N7GIYbCTXHE/unsubscribe.

For more options, visit https://groups.google.com/d/optout.

Joshua Marantz

unread,
May 2, 2017, 11:48:02 AM5/2/17
to mod-pagespeed-discuss
I see, that makes sense.  If you want Akamai to cache your HTML for a long time, then you are going to have to somehow let PageSpeed purge that cache.


Alternatively, you can set up Akamai to respect the caching headers that PageSpeed puts on resources.  For example, PageSpeed sets the cache-control:no-cache on HTML output to avoid that problem, but Akamai can be configured to override that setting (or maybe does so by default?) which is what I suspect is happening here.

And my suggestion about InPlaceResourceOptimization may not work in the presence of Akamai caching, because you have set long cache TTLs on your origin resources, and thus Akamai will capture the pre-optimized result.


In fairness I should also point out that Akamai has its own optimization solution called (I think) Aqua Ion, which you could use in lieu of mod_pagespeed, and is potentially better integrated in the Akamai flow.  However, Aqua Ion is an extra-cost add-on to Akamai, and I know that lots of sites have successfully combined Akamai & mod_pagespeed.  We just have to clean up the caching.

And you still have the problem that your <script rel="preload" ...> construct does not appear to be part of the HTML spec on preload: https://www.w3.org/TR/preload/ .  So whatever you do with your web performance setup & Akamai solution, you should probably fix that first.



To unsubscribe from this group and all its topics, send an email to mod-pagespeed-discuss+unsubscri...@googlegroups.com.




The information in this e-mail and any attachments is confidential and may be legally privileged. It is intended solely for the addressee or addressee's. If you are not an intended recipient, please delete the message and any attachments and notify the sender of nondelivery. Any use or disclosure of the contents of either is unauthorised and may be unlawful. All liability for viruses is excluded to the fullest extent permitted by law. Any views expressed in this message are those of the individual sender, except where the sender states them, with requisite authority, to be those of the organisation.

--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/CAOc1FPZQKA7UruND-SwfoGdD8g6Wn1RCx6CxvUUEd1bUHP%2BQxA%40mail.gmail.com.

DB Digital IT Helpdesk

unread,
May 2, 2017, 12:14:37 PM5/2/17
to mod-pagesp...@googlegroups.com
Thanks for this, but i am still confused how it's working for one domain & not for other both on same server & same caching rules of akamai

We have tried akamai ion POC but results were not that good as per their price tag.

I am checking with my development team on this will revert if they get any thing helpful.  

Thanks all too you.

--
You received this message because you are subscribed to a topic in the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mod-pagespeed-discuss/N7GIYbCTXHE/unsubscribe.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages