Skip to content

Commit 0ef6e48

Browse files
committed
fix: caching issues
1 parent 613841c commit 0ef6e48

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

inc/classes/rest/class-patterns.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public function get_all_brand_site_patterns(): WP_Error|WP_REST_Response {
370370
foreach ( $child_sites as $site ) {
371371
$site_patterns = array();
372372
$remote_api_key = $site['api_key'] ?? '';
373-
$remote_url = Utils::build_api_endpoint( $site['url'], 'brand-site-patterns?timestamp=' . time() ); // Add timestamp to avoid caching issues.
373+
$remote_url = Utils::build_api_endpoint( $site['url'], 'brand-site-patterns' ) . '?timestamp=' . time(); // Add timestamp to avoid caching issues.
374374

375375
if ( empty( $remote_api_key ) ) {
376376
continue; // Skip sites without API key.

inc/classes/rest/class-templates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ public function get_templates_from_connected_sites(): \WP_REST_Response {
750750
$sites_response = array();
751751
$error_log = array();
752752
foreach ( $connected_sites as $site ) {
753-
$request_url = Utils::build_api_endpoint( $site['url'], 'shared', self::NAMESPACE ) . '?timestamp=' . time();
753+
$request_url = Utils::build_api_endpoint( $site['url'], 'shared', self::NAMESPACE ) . '?timestamp=' . time(); // Add timestamp to avoid caching issues.
754754
$api_key = $site['api_key'];
755755
$response = wp_safe_remote_get(
756756
$request_url,

0 commit comments

Comments
 (0)