我注意到通过 PHP 的 readfile
或 fpassthru
技术传递的文件从不被浏览器缓存。
我该怎么“鼓励”浏览器缓存通过这些方式提供的项目?
我注意到通过 PHP 的 readfile
或 fpassthru
技术传递的文件从不被浏览器缓存。
我该怎么“鼓励”浏览器缓存通过这些方式提供的项目?
无论您的内容是否被缓存都与readfile()和类似函数无关,但是服务器可能会发出默认缓存标头(该标头将激活HTML页面和图像资源的缓存),但使用PHP通过文件时不适用。
你们必须寄送适当的头盔和你的内容,告诉浏览器,为这一资源打下一切是正确的。
例如,请看
Web作者和网站管理员的缓存教程
如何使用PHP HTTP缓存标题
最终,我找到了这个页面,并将其用作我自己实现的起点。这个页面上的示例代码以及 Pekka 指向的一些阅读都对我来说是一个很好的跳板。
I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...
<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...
I found this script online that creates a thumbnail out of a image but the thumbnail image is created with poor quality how can I improve the quality of the image. And is there a better way to create ...
如何确认来自正确来源的数字。
Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...
I wonder there is a way to post a message to a facebook business page with cURL? thanks
I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...
How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...