質問編集履歴

3

訂正

2022/09/01 00:43

投稿

fuck_you
fuck_you

スコア18

test CHANGED
File without changes
test CHANGED
@@ -1,5 +1,5 @@
1
1
  .phpを.srcで実行できるように.httacessで拡張子変更を行いました
2
- a.srcにはheader('Content-Type: application/x-javascript');を記述し、
2
+ a.srcにはheader('Content-Type: application/javascript');を記述し、
3
3
  javascriptとして処理するよう記述します
4
4
  このa.srcにキャッシュをきかせたいです
5
5
  ExpiresByType application/javascript "access plus 1 weeks"
@@ -15,7 +15,7 @@
15
15
  header('Expires: ' . gmdate('D, d M Y H:i:s T', time() + $expires));
16
16
  header('Cache-Control: private, max-age=' . $expires);
17
17
  header('Pragma: ');
18
- header('Content-Type: application/x-javascript');
18
+ header('Content-Type: application/javascript');
19
19
  ?>
20
20
  ```
21
21
 

2

追記

2022/09/01 00:42

投稿

fuck_you
fuck_you

スコア18

test CHANGED
File without changes
test CHANGED
@@ -10,6 +10,11 @@
10
10
  a.scr
11
11
 
12
12
  <?php
13
+ $expires = 36000;
14
+ header('Last-Modified: Fri Jan 01 2010 00:00:00 GMT');
15
+ header('Expires: ' . gmdate('D, d M Y H:i:s T', time() + $expires));
16
+ header('Cache-Control: private, max-age=' . $expires);
17
+ header('Pragma: ');
13
18
  header('Content-Type: application/x-javascript');
14
19
  ?>
15
20
  ```

1

追記

2022/08/31 22:24

投稿

fuck_you
fuck_you

スコア18

test CHANGED
File without changes
test CHANGED
File without changes