Changeset 14484
- Timestamp:
- 07/10/2025 04:22:42 AM (13 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/standalone/class-plugins-info-api.php
r13620 r14484 240 240 } else { 241 241 $response = $response->data; 242 wp_cache_set( $cache_key, $response, self::CACHE_GROUP, self::CACHE_EXPIRY);242 wp_cache_set( $cache_key, $response, self::CACHE_GROUP, $this->query_plugins_cache_duration( $request ) ); 243 243 } 244 244 } … … 287 287 288 288 /** 289 * Returns the cache duration for a Query Plugins request. 290 * 291 * @param Plugins_Info_API_Request $request The request object. 292 * @return int The cache duration in seconds. 293 */ 294 protected function query_plugins_cache_duration( $request ) { 295 // New / Updated plugins get a much shorter cache duration. 296 if ( in_array( $request->browse, array( 'new', 'updated' ) ) ) { 297 return 900; // 15 minutes. 298 } 299 300 // Defaults to 6 hours otherwise. 301 return self::CACHE_EXPIRY; 302 } 303 304 /** 289 305 * API Endpoint for the 'popular_tags' and 'hot_tags' API endpoints. 290 306 */
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)