Page Speed Cache Life

175 views
Skip to first unread message

Atiqul Bari Chowdhury

unread,
Jun 4, 2017, 10:56:34 AM6/4/17
to mod-pagespeed-discuss
Hi

What is the default cache lifetime for pagespeed "extend cache"?

Everyday when I test my site "magazinestaging.contentpriest.com" the page load time is high at first go, and becomes faster from next runs (I am using chrome's console and cache is disabled).

My guess is that pagespeed cache lifetime is not behaving. How do I deal with it (my server is apache 2.4x, mod_http2 activated)

Here are my configuration files

Pagespeed main configuration

<IfModule pagespeed_module>
    # Turn on or off the module
    ModPagespeed on
    # Enable https fetching
    ModPagespeedFetchHttps enable,allow_self_signed,allow_unknown_certificate_authority,allow_certificate_not_yet_valid
   
    # We want VHosts to inherit global configuration.
    ModPagespeedInheritVHostConfig on

    # Direct Apache to send all HTML output to the mod_pagespeed output handler.
    AddOutputFilterByType MOD_PAGESPEED_OUTPUT_FILTER text/html

    
# The ModPagespeedFileCachePath directory must exist and be writable
    ModPagespeedFileCachePath            "/var/cache/mod_pagespeed/"

    # LogDir is needed to store various logs, including the statistics log
    ModPagespeedLogDir "/var/log/pagespeed"
  

    # A portion of the cache can be kept in memory only, to reduce load on disk

    ModPagespeedCreateSharedMemoryMetadataCache "/var/cache/mod_pagespeed/" 51200

    # Override the mod_pagespeed 'rewrite level'. The default level
    ModPagespeedRewriteLevel PassThrough
    
    # Extending expiry
    ModPagespeedRewriteDeadlinePerFlushMs 100

# Other defaults (cache sizes and thresholds):
    ModPagespeedFileCacheSizeKb          1000000
    ModPagespeedFileCacheCleanIntervalMs 3600000
    ModPagespeedLRUCacheKbPerProcess     1024
    ModPagespeedLRUCacheByteLimit        16384
    ModPagespeedCssFlattenMaxBytes       20000
    ModPagespeedCssInlineMaxBytes        5000
    # ModPagespeedCssImageInlineMaxBytes   0
    # ModPagespeedImageInlineMaxBytes      3072
    # ModPagespeedJsInlineMaxBytes         2048
    # ModPagespeedCssOutlineMinBytes       3000
    # ModPagespeedJsOutlineMinBytes        3000
    ModPagespeedMaxCombinedCssBytes      50000
    ModPagespeedMaxCombinedJsBytes       150000

    # 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


   ModPagespeedEnableFilters canonicalize_javascript_libraries


  
   
  



    # 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
        SetHandler pagespeed_admin
    </Location>
    <Location /pagespeed_global_admin>
        Order allow,deny
        Allow from localhost
        Allow from 127.0.0.1
        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
</IfModule>

Pagespeed Virtual Host Configuration

#MOD PAGESPEED SETTINGS
<IfModule pagespeed_module>
    ModPagespeedSslCertDirectory "/etc/letsencrypt/live/magazinestaging.contentpriest.com/"
    ModPagespeedEnableFilters add_head
ModPagespeedEnableFilters inline_import_to_link
#ModPagespeedEnableFilters move_css_above_script
ModPagespeedEnableFilters combine_css
ModPagespeedEnableFilters rewrite_style_attributes_with_url
ModPagespeedEnableFilters fallback_rewrite_css_urls
    ModPagespeedEnableFilters rewrite_css
ModPagespeedEnableFilters flatten_css_imports
    ModPagespeedEnableFilters prioritize_critical_css
ModPagespeedEnableFilters rewrite_javascript
ModPagespeedEnableFilters combine_javascript
ModPagespeedEnableFilters inline_google_font_css
ModPagespeedEnableFilters extend_cache
    ModPagespeedEnableFilters local_storage_cache
</IfModule>

Joshua Marantz

unread,
Jun 4, 2017, 12:49:00 PM6/4/17
to mod-pagespeed-discuss
There's two sides of caching in PageSpeed.  Browser-side caching should be 1 year, but that only works with a warm server-side cache.  Server-side caches may be cold because of the origin cache TTL, or because of server-side cache eviction.

Please read https://modpagespeed.com/doc/filter-cache-extend for more details on this.

-Josh


--
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+unsubscri...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/6b5e6f03-274c-4e09-b893-dcf7de6d65dd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages