Skip to content

Commit ae527bd

Browse files
psaizdianarand
authored andcommitted
fix: improve lighthouse scoring
1 parent a4120b0 commit ae527bd

5 files changed

Lines changed: 11 additions & 10 deletions

File tree

cernopendata/modules/globals/ext.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class GlobalVariables:
4343
"totem": {
4444
"name": "TOTEM",
4545
"url": "totem-experiment.web.cern.ch",
46-
"width": "auto",
4746
},
4847
}
4948

cernopendata/modules/pages/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ def index():
9090
except Exception:
9191
pass
9292
return render_template(
93-
"cernopendata_pages/front/index.html", featured_articles=results
93+
"cernopendata_pages/front/index.html",
94+
featured_articles=results,
95+
description="Portal to the High Energy Physics data from CERN",
9496
)
9597

9698

cernopendata/templates/cernopendata_theme/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<img
1010
src="{{ url_for('static', filename='img/experiments/{}.gif'.format(id)) }}"
1111
alt="{{ exp.name }} experiment"
12-
width="{{ exp.get('width', 55) }}"
12+
width="{{ exp.get('width', 'auto') }}"
1313
height="{{ exp.get('height', 55) }}"
1414
/>
1515
</a>

cernopendata/templates/cernopendata_theme/page.html

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
{{ super() }}
55
{{ webpack['cernopendata_css.css'] }}
66
{{ webpack['glossary_css.css'] }}
7-
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
8-
<!--[if lt IE 9]>
9-
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
10-
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
11-
<![endif]-->
127
{%- endblock css %}
138

149
{%- block bypasslinks %}
@@ -72,8 +67,6 @@
7267
"HTML-CSS": { availableFonts: ["TeX"], matchFontHeight: false }
7368
});
7469
</script>
75-
76-
<script type="text/javascript" src="{{ config['THEME_MATHJAX_CDN'] }}"></script>
7770
{% endblock %}
7871

7972
{%- block jsonld_serialization %}{%- endblock jsonld_serialization %}

nginx/localhost.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ server {
5959

6060
location /static {
6161
root /opt/invenio/var/instance;
62+
# Cache for 30 days
63+
expires 30d;
64+
# Cache-Control header
65+
add_header Cache-Control "public, max-age=2592000, immutable";
66+
# Compress
67+
gzip on;
68+
gzip_types text/css application/javascript;
6269
}
6370

6471
# Old reverse proxy to EOS locations used from COD2 times. (Not advertised

0 commit comments

Comments
 (0)