Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
3440240e
Commit
3440240e
authored
7 years ago
by
kevalbhatt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-2090 : UI - Cache busting for static content (css, js)
parent
979200e7
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
28 deletions
+54
-28
gruntfile.js
dashboardv2/gruntfile.js
+21
-3
package.json
dashboardv2/package.json
+1
-0
index.html.tpl
dashboardv2/public/index.html.tpl
+31
-25
main.js
dashboardv2/public/js/main.js
+1
-0
No files found.
dashboardv2/gruntfile.js
View file @
3440240e
...
...
@@ -23,8 +23,8 @@ module.exports = function(grunt) {
var
classPathSep
=
(
process
.
platform
===
"win32"
)
?
';'
:
':'
,
gitHash
=
''
,
pkg
=
grunt
.
file
.
readJSON
(
'package.json'
),
buildTime
=
new
Date
().
getTime
(),
distPath
=
'dist'
,
publicPath
=
'public'
,
libPath
=
distPath
+
'/js/libs'
,
isDashboardDirectory
=
grunt
.
file
.
isDir
(
'public'
),
modulesPath
=
'public/'
;
...
...
@@ -259,6 +259,18 @@ module.exports = function(grunt) {
dest
:
'dist/js/templates'
}]
}
},
template
:
{
build
:
{
options
:
{
data
:
{
'bust'
:
buildTime
}
},
files
:
{
[
distPath
+
'/index.html'
]:
[
modulesPath
+
'/index.html.tpl'
]
}
}
}
});
...
...
@@ -269,6 +281,7 @@ module.exports = function(grunt) {
grunt
.
loadNpmTasks
(
'grunt-contrib-uglify'
);
grunt
.
loadNpmTasks
(
'grunt-contrib-cssmin'
);
grunt
.
loadNpmTasks
(
'grunt-contrib-htmlmin'
);
grunt
.
loadNpmTasks
(
'grunt-template'
);
require
(
'load-grunt-tasks'
)(
grunt
);
...
...
@@ -287,6 +300,7 @@ module.exports = function(grunt) {
'npmcopy:license'
,
'copy:dist'
,
'sass:dist'
,
'template'
,
'configureProxies:server'
,
'connect:server'
,
'watch'
...
...
@@ -298,7 +312,8 @@ module.exports = function(grunt) {
'npmcopy:css'
,
'npmcopy:license'
,
'copy:build'
,
'sass:build'
'sass:build'
,
'template'
]);
grunt
.
registerTask
(
'dev-minify'
,
[
...
...
@@ -310,6 +325,7 @@ module.exports = function(grunt) {
'sass:dist'
,
'uglify:build'
,
'cssmin:build'
,
'template'
,
'configureProxies:server'
,
'connect:server'
,
'watch'
...
...
@@ -323,6 +339,7 @@ module.exports = function(grunt) {
'copy:build'
,
'sass:build'
,
'uglify:build'
,
'cssmin:build'
'cssmin:build'
,
'template'
]);
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv2/package.json
View file @
3440240e
...
...
@@ -70,6 +70,7 @@
"grunt-npmcopy"
:
"^0.1.0"
,
"grunt-sass"
:
"^1.1.0"
,
"grunt-shell"
:
"^1.1.1"
,
"grunt-template"
:
"^1.0.0"
,
"load-grunt-tasks"
:
"^3.1.0"
,
"proxit"
:
"~0.6.4"
}
...
...
This diff is collapsed.
Click to expand it.
dashboardv2/public/index.html
→
dashboardv2/public/index.html
.tpl
View file @
3440240e
...
...
@@ -19,8 +19,8 @@
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 7]>
<script src="js/external_lib/es5-shim.min.js"></script>
<script src="js/external_lib/respond.min.js"></script>
<script src="js/external_lib/es5-shim.min.js
?bust=<%- bust %>
"></script>
<script src="js/external_lib/respond.min.js
?bust=<%- bust %>
"></script>
<![endif]-->
<!--[if gt IE 8]><!-->
<html
class=
"no-js"
>
...
...
@@ -29,32 +29,32 @@
<head>
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge,chrome=1"
>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8;
Cache-Control: no-cache
"
/>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8;"
/>
<title>
Atlas
</title>
<meta
name=
"description"
content=
""
>
<meta
name=
"viewport"
content=
"width=device-width"
>
<link
rel=
"shortcut icon"
href=
"favicon.ico"
type=
"image/x-icon"
>
<link
rel=
"icon"
href=
"favicon.ico"
type=
"image/x-icon"
>
<link
rel=
"shortcut icon"
href=
"favicon.ico
?bust=<%- bust %>
"
type=
"image/x-icon"
>
<link
rel=
"icon"
href=
"favicon.ico
?bust=<%- bust %>
"
type=
"image/x-icon"
>
<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/animate.min.css"
/>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid/css/backgrid.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-filter/css/backgrid-filter.min.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-paginator/css/backgrid-paginator.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-orderable-columns/css/backgrid-orderable-columns.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-columnmanager/css/Backgrid.ColumnManager.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/select2/css/select2.min.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/bootstrap/css/bootstrap.min.css"
>
<link
rel=
"stylesheet"
href=
"js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.min.css"
>
<link
rel=
"stylesheet"
href=
"css/googlefonts.css"
type=
'text/css'
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"js/external_lib/jquery-ui/jquery-ui.min.css"
>
<link
href=
"css/bootstrap-sidebar.css"
rel=
"stylesheet"
>
<link
href=
"js/libs/font-awesome/css/font-awesome.min.css"
rel=
"stylesheet"
>
<link
href=
"js/external_lib/pnotify/pnotify.custom.min.css"
rel=
"stylesheet"
>
<link
href=
"js/libs/jQueryQueryBuilder/css/query-builder.default.min.css"
rel=
"stylesheet"
>
<link
href=
"js/libs/bootstrap-daterangepicker/css/daterangepicker.css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"js/libs/nvd3/css/nv.d3.min.css"
>
<link
href=
"css/style.css"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"css/animate.min.css
?bust=<%- bust %>
"
/>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid/css/backgrid.css
?bust=<%- bust %>
"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-filter/css/backgrid-filter.min.css
?bust=<%- bust %>
"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-paginator/css/backgrid-paginator.css
?bust=<%- bust %>
"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-orderable-columns/css/backgrid-orderable-columns.css
?bust=<%- bust %>
"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-sizeable-columns/css/backgrid-sizeable-columns.css
?bust=<%- bust %>
"
>
<link
rel=
"stylesheet"
href=
"js/libs/backgrid-columnmanager/css/Backgrid.ColumnManager.css
?bust=<%- bust %>
"
>
<link
rel=
"stylesheet"
href=
"js/libs/select2/css/select2.min.css
?bust=<%- bust %>
"
>
<link
rel=
"stylesheet"
href=
"js/libs/bootstrap/css/bootstrap.min.css
?bust=<%- bust %>
"
>
<link
rel=
"stylesheet"
href=
"js/libs/jquery-asBreadcrumbs/css/asBreadcrumbs.min.css
?bust=<%- bust %>
"
>
<link
rel=
"stylesheet"
href=
"css/googlefonts.css
?bust=<%- bust %>
"
type=
'text/css'
>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"js/external_lib/jquery-ui/jquery-ui.min.css
?bust=<%- bust %>
"
>
<link
href=
"css/bootstrap-sidebar.css
?bust=<%- bust %>
"
rel=
"stylesheet"
>
<link
href=
"js/libs/font-awesome/css/font-awesome.min.css
?bust=<%- bust %>
"
rel=
"stylesheet"
>
<link
href=
"js/external_lib/pnotify/pnotify.custom.min.css
?bust=<%- bust %>
"
rel=
"stylesheet"
>
<link
href=
"js/libs/jQueryQueryBuilder/css/query-builder.default.min.css
?bust=<%- bust %>
"
rel=
"stylesheet"
>
<link
href=
"js/libs/bootstrap-daterangepicker/css/daterangepicker.css
?bust=<%- bust %>
"
rel=
"stylesheet"
>
<link
rel=
"stylesheet"
href=
"js/libs/nvd3/css/nv.d3.min.css
?bust=<%- bust %>
"
>
<link
href=
"css/style.css
?bust=<%- bust %>
"
rel=
"stylesheet"
>
</head>
<body>
...
...
@@ -72,8 +72,13 @@
</div>
</div>
<!-- build:js scripts/main.js -->
<script
data-main=
"js/main
"
src=
"js/libs/requirejs/require.js
"
></script>
<script
data-main=
"js/main
.js?bust=<%- bust %>"
src=
"js/libs/requirejs/require.js?bust=<%- bust %>
"
></script>
<!-- endbuild -->
<script
type=
"text/javascript"
>
var
getBustValue
=
function
()
{
return
'<%- bust %>'
}
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
dashboardv2/public/js/main.js
View file @
3440240e
...
...
@@ -27,6 +27,7 @@ require.config({
'templateExtension'
:
'html'
,
// Set the extension automatically appended to templates
'compileOptions'
:
{}
// options object which is passed to Handlebars compiler
},
'urlArgs'
:
"bust="
+
getBustValue
(),
/**
* Requested as soon as the loader has processed the configuration. It does
* not block any other require() calls from starting their requests for
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment