File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 - Rename file_hash to data_hash to reflect that it
3535 can include metadata.
3636 - Add deployed_at column and an index on it.
37+ - Batch queries to the deployed_files table for better
38+ performance.
3739
3840## 9.3.2 (2025-07-29)
3941
Original file line number Diff line number Diff line change @@ -137,34 +137,6 @@ public static function addFile(
137137 $ wpdb ->query ( $ sql );
138138 }
139139
140- /**
141- * Checks if file can skip deployment
142- * - uses hash of file and path's hash
143- */
144- public static function fileisCached (
145- string $ path ,
146- string $ ns = self ::DEFAULT_NAMESPACE ,
147- string $ data_hash ,
148- ): bool {
149- global $ wpdb ;
150-
151- $ path_hash = md5 ( $ path );
152-
153- $ table_name = self ::getTableName ();
154-
155- $ sql = $ wpdb ->prepare (
156- "SELECT path_hash FROM $ table_name WHERE " .
157- ' path_hash = %s AND data_hash = %s AND namespace = %s LIMIT 1 ' ,
158- $ path_hash ,
159- $ data_hash ,
160- $ ns
161- );
162-
163- $ hash = $ wpdb ->get_var ( $ sql );
164-
165- return (bool ) $ hash ;
166- }
167-
168140 public static function truncate (
169141 string $ ns = ''
170142 ): void {
Original file line number Diff line number Diff line change @@ -194,13 +194,8 @@ public function uploadFilesIter( \Iterator $path_infos ): void {
194194 }
195195 }
196196
197- $ is_cached = DeployCache::fileisCached (
198- $ cache_key ,
199- self ::DEFAULT_NAMESPACE ,
200- $ hash ,
201- );
202-
203- if ( $ is_cached ) {
197+ if ( isset ( $ path_info ->deploy_cache )
198+ && ( $ path_info ->deploy_cache [ self ::DEFAULT_NAMESPACE ] ?? null ) === $ hash ) {
204199 ++$ this ->deploy_cache_ct ;
205200 if ( STATIC_DEPLOY_DEBUG ) {
206201 WsLog::d ( 'Skipping deploy of cached file ' . $ cache_key );
You can’t perform that action at this time.
0 commit comments