{"id":1807,"date":"2017-06-15T11:36:20","date_gmt":"2017-06-15T09:36:20","guid":{"rendered":"https:\/\/blog.kodono.info\/wordpress\/?p=1807"},"modified":"2017-06-15T11:55:42","modified_gmt":"2017-06-15T09:55:42","slug":"how-to-cache-the-css-fonts-with-sharepoint","status":"publish","type":"post","link":"https:\/\/blog.kodono.info\/wordpress\/2017\/06\/15\/how-to-cache-the-css-fonts-with-sharepoint\/","title":{"rendered":"How to cache the CSS Fonts with Sharepoint"},"content":{"rendered":"<p>If you use your own CSS file with your own CSS fonts, then we&#8217;ll notice that Sharepoint doesn&#8217;t send cache headers if you use the below CSS code:<\/p>\n<pre class=\"brush:css\">\r\n@font-face {\r\n  font-family: 'Roboto';\r\n  src: url('\/_catalogs\/masterpage\/css\/fonts\/Roboto\/Regular\/Roboto-Regular.woff2') format('woff2'),\r\n       url('\/_catalogs\/masterpage\/css\/fonts\/Roboto\/Regular\/Roboto-Regular.woff') format('woff'),\r\n       url('\/_catalogs\/masterpage\/css\/fonts\/Roboto\/Regular\/Roboto-Regular.ttf') format('truetype');\r\n  font-weight: 400;\r\n  font-style: normal;\r\n}\r\n<\/pre>\n<p>To have this resource sent back from the Sharepoint server with cache headers, you just need to add <code>?ctag=0<\/code> at the end:<\/p>\n<pre class=\"brush:css\">\r\n@font-face {\r\n  font-family: 'Roboto';\r\n  src: url('\/_catalogs\/masterpage\/css\/fonts\/Roboto\/Regular\/Roboto-Regular.woff2?ctag=0') format('woff2'),\r\n       url('\/_catalogs\/masterpage\/css\/fonts\/Roboto\/Regular\/Roboto-Regular.woff?ctag=0') format('woff'),\r\n       url('\/_catalogs\/masterpage\/css\/fonts\/Roboto\/Regular\/Roboto-Regular.ttf?ctag=0') format('truetype');\r\n  font-weight: 400;\r\n  font-style: normal;\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you use your own CSS file with your own CSS fonts, then we&#8217;ll notice that Sharepoint doesn&#8217;t send cache headers if you use the below CSS code: @font-face { font-family: &#8216;Roboto&#8217;; src: url(&#8216;\/_catalogs\/masterpage\/css\/fonts\/Roboto\/Regular\/Roboto-Regular.woff2&#8217;) format(&#8216;woff2&#8217;), url(&#8216;\/_catalogs\/masterpage\/css\/fonts\/Roboto\/Regular\/Roboto-Regular.woff&#8217;) format(&#8216;woff&#8217;), url(&#8216;\/_catalogs\/masterpage\/css\/fonts\/Roboto\/Regular\/Roboto-Regular.ttf&#8217;) format(&#8216;truetype&#8217;); font-weight: 400; font-style: normal; } To have this resource sent back from the Sharepoint server with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_coblocks_attr":"","_coblocks_dimensions":"","_coblocks_responsive_height":"","_coblocks_accordion_ie_support":"","hide_page_title":"","footnotes":""},"categories":[15,170,11,81],"tags":[153,30,123,151,164,158,117],"class_list":["post-1807","post","type-post","status-publish","format-standard","hentry","category-astuce","category-english","category-niveau-debutant","category-performance","tag-astuce","tag-css","tag-english","tag-niveau-debutant","tag-performance","tag-programmation","tag-sharepoint"],"_links":{"self":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/1807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/comments?post=1807"}],"version-history":[{"count":2,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/1807\/revisions"}],"predecessor-version":[{"id":1809,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/posts\/1807\/revisions\/1809"}],"wp:attachment":[{"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/media?parent=1807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/categories?post=1807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.kodono.info\/wordpress\/wp-json\/wp\/v2\/tags?post=1807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}