Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

권범준 - 렌더링 최적화 #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions optimize/quiz3/Bum_Jun_Kwon/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("We are almost done with Browser Critical Rendering Optimization");
Binary file added optimize/quiz3/Bum_Jun_Kwon/before.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added optimize/quiz3/Bum_Jun_Kwon/final.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions optimize/quiz3/Bum_Jun_Kwon/ga-analytics.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
16 changes: 16 additions & 0 deletions optimize/quiz3/Bum_Jun_Kwon/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<html>
<head>
<meta name="viewport" content="width=device-width">
<link rel="prefetch" href="photo.png">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lyuesia - 범준님 prefetch를 잘 적용하셨네요!

<link href="style.css" rel="stylesheet">
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Lyuesia - 최적화의 관점에서 외부 CSS 파일 로딩 대신에 인라인 스타일이나 <style>로 빼주셔도 좋을 것 같습니다.

<link href="print.css" rel="stylesheet" media="print">
</head>
<body>
<script src="ga-analytics.js"></script>
<p>
Hello <span>Fast Campus WAP Camp</span> students!
</p>
<div><img src="photo.png"></div>
<script src="app.js" async></script>
</body>
</html>
17 changes: 17 additions & 0 deletions optimize/quiz3/Bum_Jun_Kwon/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "quiz3",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"ejs": "^2.5.7",
"express": "^4.15.4"
}
}
Binary file added optimize/quiz3/Bum_Jun_Kwon/photo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions optimize/quiz3/Bum_Jun_Kwon/print.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@media screen and (min-width: 1200px) {
span {
color: black;
}
}
18 changes: 18 additions & 0 deletions optimize/quiz3/Bum_Jun_Kwon/server.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
var express = require('express');
var app = express();
var path = require('path');

app.use(express.static(__dirname));

// view engine setup
// __dirname : root folder
app.set('views', path.join(__dirname));
app.set('view engine', 'ejs');
app.engine('html', require('ejs').renderFile);

app.get('/', function (req, res) {
res.send('index');
});

app.listen(3000);
console.log("Server running on port 3000");
3 changes: 3 additions & 0 deletions optimize/quiz3/Bum_Jun_Kwon/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
span {
color: blue;
}