Browse Source

Use "as" in preload headers

spaghetti 8 years ago
parent
commit
fba77cc085
2 changed files with 3 additions and 4 deletions
  1. 3
    3
      classes/view.class.php
  2. 0
    1
      sections/stats/users.php

+ 3
- 3
classes/view.class.php View File

@@ -34,12 +34,12 @@ class View {
34 34
       $Styles = array_merge(['tooltipster'], explode(',', $CSSIncludes));
35 35
       foreach ($Scripts as $Script) {
36 36
         if (trim($Script) == '') { continue; }
37
-        header('Link: <'.STATIC_SERVER.'functions/'.$Script.'.js?v='.filemtime(SERVER_ROOT.STATIC_SERVER.'functions/'.$Script.'.js').'>; rel=preload;', false);
37
+        header('Link: <'.STATIC_SERVER.'functions/'.$Script.'.js?v='.filemtime(SERVER_ROOT.STATIC_SERVER.'functions/'.$Script.'.js').'>; rel=preload; as=script;', false);
38 38
       }
39
-      header('Link: <'.STATIC_SERVER.'styles/global.css?v='.filemtime(SERVER_ROOT.STATIC_SERVER.'styles/global.css').'>; rel=preload;', false);
39
+      header('Link: <'.STATIC_SERVER.'styles/global.css?v='.filemtime(SERVER_ROOT.STATIC_SERVER.'styles/global.css').'>; rel=preload; as=style', false);
40 40
       foreach ($Styles as $Style) {
41 41
         if (trim($Style) == '') { continue; }
42
-        header('Link: <'.STATIC_SERVER.'styles/'.$Style.'/style.css?v='.filemtime(SERVER_ROOT.STATIC_SERVER.'styles/'.$Style.'/style.css').'>; rel=preload;', false);
42
+        header('Link: <'.STATIC_SERVER.'styles/'.$Style.'/style.css?v='.filemtime(SERVER_ROOT.STATIC_SERVER.'styles/'.$Style.'/style.css').'>; rel=preload; as=style;', false);
43 43
       }
44 44
       require(SERVER_ROOT.'/design/privateheader.php');
45 45
     }

+ 0
- 1
sections/stats/users.php View File

@@ -1,6 +1,5 @@
1 1
 <?
2 2
 if (!list($Countries, $Rank, $CountryUsers, $CountryMax, $CountryMin, $LogIncrements) = $Cache->get_value('geodistribution')) {
3
-  include_once(SERVER_ROOT.'/classes/charts.class.php');
4 3
   $DB->query('
5 4
     SELECT Code, Users
6 5
     FROM users_geodistribution');

Loading…
Cancel
Save