Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when in debug mode, reduce sitemap cache duration #13179

Merged
merged 4 commits into from
Aug 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion modules/sitemaps/sitemap-constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@
* @author Automattic
*/

/**
* Number of seconds between sitemap and news sitemap updates in development code.
* In production, sitemaps are cached for 12 hours.
* In development, sitemaps are cache for 1 minute.
*
* @since 7.7.0
*/
if ( defined( 'JETPACK_DEV_DEBUG' ) && JETPACK_DEV_DEBUG ) {
if ( ! defined( 'JP_SITEMAP_INTERVAL') ) {
define( 'JP_SITEMAP_INTERVAL', 60 );
}
if ( ! defined( 'JP_NEWS_SITEMAP_INTERVAL') ) {
define( 'JP_NEWS_SITEMAP_INTERVAL', 60 );
}
}

/**
* Maximum size (in bytes) of a sitemap xml file.
* Max is 716800 = 700kb to avoid potential failures for default memcached limits (1MB)
Expand Down Expand Up @@ -77,7 +93,7 @@
}

/**
* Cache lifetime of news sitemap (in seconds).
* Number of seconds between news sitemap updates.
paulschreiber marked this conversation as resolved.
Show resolved Hide resolved
*
* @since 4.8.0
*/
Expand Down