Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/255.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何强制浏览器缓存文本文件(.ttf)_Php_Html_Css_Browser_Server - Fatal编程技术网

Php 如何强制浏览器缓存文本文件(.ttf)

Php 如何强制浏览器缓存文本文件(.ttf),php,html,css,browser,server,Php,Html,Css,Browser,Server,我正在制作一个网站。 在 而且在制作另一个方面也很有经验 我面临一个问题, 我的服务器中有一个文本文件(MontserratRegular.ttf)。我将此文件链接到所有页面的每个“.css”。 问题是,浏览器会下载它,以便根据每个页面的请求进行阅读。文本文件大约为250KB,大小有点大。这可能会干扰网速较慢的用户。有解决方案吗?配置Web服务器以提供缓存头。例如,对于apache Web服务器和mod_expires: <IfModule mod_expires.c> Expi

我正在制作一个网站。 在 而且在制作另一个方面也很有经验 我面临一个问题, 我的服务器中有一个文本文件(MontserratRegular.ttf)。我将此文件链接到所有页面的每个“.css”。
问题是,浏览器会下载它,以便根据每个页面的请求进行阅读。文本文件大约为250KB,大小有点大。这可能会干扰网速较慢的用户。有解决方案吗?

配置Web服务器以提供缓存头。例如,对于apache Web服务器和mod_expires:

<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 300 seconds"

  ExpiresByType image/gif "access plus 1 month 1 hour"
  ExpiresByType image/jpg "access plus 1 month 1 hour"
  ExpiresByType image/jpeg "access plus 1 month 1 hour"
  ExpiresByType image/png "access plus 1 month 1 hour"
  ExpiresByType application/x-shockwave-flash "access plus 1 day 1 hour"
</IfModule>

过期于
ExpiresDefault“访问加300秒”
ExpiresByType image/gif“访问加1个月1小时”
ExpiresByType图像/jpg“访问加1个月1小时”
ExpiresByType图像/jpeg“访问加1个月1小时”
ExpiresByType image/png“访问加1个月1小时”
过期按类型应用程序/x-shockwave-flash“访问加1天1小时”

使用ttf文件根据您的需要进行自定义。

我的网站是您使用的是SASS还是更少?,任何代码、代码层、JSFIDLE等都非常好。250KB不会太大。请出示您的密码。我想您可以访问它plz吗?snpskollam.cf代码太大