Skip to content

Commit

Permalink
Preload json [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
diegovalle committed Mar 8, 2024
1 parent 2f78ade commit ad6f4ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions elcri.men/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ module.exports = {
'/acerca/': [
'Link: </static/source-sans-pro-v13-latin-regular.subset-6b67f4639bb02f388b7e72e34e180d7f.woff2>; rel=preload; as=font; crossorigin',
],
'/tendencias-estado/': [
'Link: <https://trends.elcri.men/states_trends.json>; rel=preload; as=fetch; crossorigin',
],
'/trends-states/': [
'Link: <https://trends.elcri.men/states_trends.json>; rel=preload; as=fetch; crossorigin',
],
}, // option to add more headers. `Link` headers are transformed by the below criteria
},
},
Expand Down
11 changes: 11 additions & 0 deletions elcri.men/src/pages/tendencias-estado.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ function TrendsDeriv (props) {

return (
<Layout locale={props.pageContext.locale} path={props.location.pathname}>
<Helmet
link={[
{
rel: 'preload',
href:
'https://trends.elcri.men/states_trends.json',
as: 'fetch',
crossorigin: 'anonymous',
},
]}
/>
<SEO
title={intl.formatMessage ({id: 'title_trends_states'})}
description={intl.formatMessage ({id: 'desc_trends_states'})}
Expand Down

0 comments on commit ad6f4ff

Please sign in to comment.