ホーム > アーカイブ > 2010年5月のアーカイブ
2010年5月のアーカイブ
gooモバイルURL登録申請ページが出来てた。
- 2010/05/29 22:59
- SEO
Webページの読込み速度UP
- 2010/05/27 00:57
- SEO
JavaScriptとスタイルシートの記述順を変えるだけで読込みスピードが変わるみたい。
■悪い例
<head>
<link rel=”stylesheet” type=”text/css” href=”stylesheet1.css” />
<script type=”text/javascript” src=”script1.js” />
<script type=”text/javascript” src=”script2.js” />
<link rel=”stylesheet” type=”text/css” href=”stylesheet2.css” />
<link rel=”stylesheet” type=”text/css” href=”stylesheet3.css” />
</head>
※読み込み順は、
1. stylesheet1.css
2. script1.js
3. script2.js
4. stylesheet2.css / stylesheet3.css(並行)
■良い例
<head>
<link rel=”stylesheet” type=”text/css” href=”stylesheet1.css” />
<link rel=”stylesheet” type=”text/css” href=”stylesheet2.css” />
<link rel=”stylesheet” type=”text/css” href=”stylesheet3.css” />
<script type=”text/javascript” src=”script1.js” />
<script type=”text/javascript” src=”script2.js” />
</head>
※読み込み順は、
1. stylesheet1.css / stylesheet2.css / stylesheet3.css(並行)
2. scriptfile1.js
3. scriptfile2.js
スタイルシートは複数のファイルを同時に読み込むことができる。
JavaScriptは読み込みが完了してからでないと次のコードの読み込みが始まらない。
そのため、複数のスタイルシート指定の間にJavaScriptを入れると遅くなるとの事。
php header 301 302 303 307リダイレクト方法
- 2010/05/25 01:12
- PHP + MySQL
header – 生の HTTP ヘッダを送信する
void header ( string $string [, bool $replace = true [, int $http_response_code ]] )
header() は、生の HTTP ヘッダを送信するために使用されます。 HTTP ヘッダについての詳細な情報は >> HTTP/1.1 仕様 を参照ください。
覚えておいて頂きたいのは、header() 関数は、 通常の HTML タグまたは PHP からの出力にかかわらず、すべての実際の 出力の前にコールする必要があることです。 頻出するエラーとして、include() または require() 関数、他のファイルをアクセスする関数に 空白または空行があり、header() の前に出力が 行われてしまうというものがあります。同じ問題は、単一の PHP/HTML ファイルを使用している場合でも存在します。
// 301 Moved Permanently
header(‘Location: http://example.com/’, true, 301);
// 302 Found
header(‘Location: http://example.com/’, true, 302);
header(‘Location: http://example.com/’);
// 303 See Other
header(‘Location: http://example.com/’, true, 303);
// 307 Temporary Redirect
header(‘Location: http://example.com/’, true, 307);
ホーム > アーカイブ > 2010年5月のアーカイブ
- 検索
- フィード
- メタ情報
- あと何日
- ブログパーツ
- QRコード