includes/clientside/jsres.php
changeset 746 f81f2a4f8d04
parent 699 c7d737202d59
child 779 609e35845ec3
equal deleted inserted replaced
745:0a3866f74faa 746:f81f2a4f8d04
   292     }
   292     }
   293     if ( is_array($cache_file) && isset($cache_file['md5']) && isset($cache_file['src']) )
   293     if ( is_array($cache_file) && isset($cache_file['md5']) && isset($cache_file['src']) )
   294     {
   294     {
   295       if ( $cache_file['md5'] === $file_md5 )
   295       if ( $cache_file['md5'] === $file_md5 )
   296       {
   296       {
       
   297         header("X-Cache-Status: cache HIT, hash $file_md5");
   297         $loaded_cache = true;
   298         $loaded_cache = true;
   298         $file_contents = $cache_file['src'];
   299         $file_contents = $cache_file['src'];
   299       }
   300       }
   300     }
   301     }
   301   }
   302   }
   313           'md5' => $file_md5,
   314           'md5' => $file_md5,
   314           'src' => $file_contents
   315           'src' => $file_contents
   315         ));
   316         ));
   316       fwrite($handle, $payload);
   317       fwrite($handle, $payload);
   317       fclose($handle);
   318       fclose($handle);
   318     }
   319       header("X-Cache-Status: cache MISS, new generated");
       
   320     }
       
   321     else
       
   322     {
       
   323       header("X-Cache-Status: cache MISS, not generated");
       
   324     }
       
   325   }
       
   326   else if ( !$loaded_cache )
       
   327   {
       
   328     header("X-Cache-Status: cache MISS, not generated");
   319   }
   329   }
   320   
   330   
   321   return $file_contents;
   331   return $file_contents;
   322 }
   332 }
   323 
   333