久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

PHPs fopen 函數是否實現了某種緩存?

Does PHPs fopen function implement some kind of cache?(PHPs fopen 函數是否實現了某種緩存?)
本文介紹了PHPs fopen 函數是否實現了某種緩存?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在努力從網絡服務器收集 PHP 腳本的自動數據.相關文件包含氣象數據,每 10 分鐘更新一次.奇怪的是,網絡服務器上的文件修改"日期沒有改變.

I'm struggling with the automated data collection of a PHP script from a webserver. The files in question contain meteo data and are updated every 10 minutes. Weirdly enough, the 'file modified' date on the webserver doesn't change.

一個簡單的fopen('http://...')-命令試圖獲取每小時此目錄中最后一個文件的最新版本.但通常我最終會得到一個長達 4 小時的版本.這發生在 Linux 服務器上(正如我的系統管理員向我保證的那樣)不使用任何類型的代理服務器.

A simple fopen('http://...')-command tries to get the freshest version of the last file in this directory every hour. But regularly I end up with a version up to 4 hours old. This happens on a Linux server which (As my system administrator has assured me) doesn't use a proxy server of any kind.

PHP 是否實現了自己的緩存機制?或者還有什么可能會干擾這里?

Does PHP implement its own caching mechanism? Or what else could be interfering here?

(我目前的解決方法是通過有效的 exec('wget --nocache...') 獲取文件.)

(My current workaround is to grab the file via exec('wget --nocache...') which works.)

推薦答案

由于您通過 HTTP 獲取文件,因此我假設 PHP 將遵守服務器響應的任何緩存標頭.

Since you're getting the file via HTTP, I'm assuming that PHP will be honouring any cache headers the server is responding with.

避免這種情況的一種非常簡單和骯臟的方法是向每個請求附加一些隨機獲取參數.

A very simple and dirty way to avoid that is to append some random get parameter to each request.

這篇關于PHPs fopen 函數是否實現了某種緩存?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 国产一级免费视频 | 欧美色图综合网 | 日本在线观看视频 | 国产精品夜夜夜一区二区三区尤 | 久久久男人的天堂 | 日韩一区在线播放 | 一区二区精品电影 | 91精品久久久久久久久 | 91精品国产综合久久久久蜜臀 | 欧美亚洲国产日韩 | 国产亚洲二区 | 91美女在线 | 国产做a爱免费视频 | 中文字幕中文字幕 | wwwww在线观看 | 精久久久久 | 成人免费大片黄在线播放 | 色综合一区二区 | 久婷婷 | 日韩精品一区二区在线 | 中文字幕一区在线 | 国产色在线 | 99精品电影| 日本三级黄视频 | 全免费a级毛片免费看视频免费下 | 成人激情视频免费在线观看 | 精品三区| av网站观看| 在线中文视频 | 成人精品在线观看 | 国产精品一二三区 | 日韩一区二区三区视频 | 青春草国产 | 国产精品久久久久久久免费观看 | 日韩乱码在线 | 亚洲欧美国产精品久久 | 久久成人精品 | 亚洲一区二区三区 | 国产精品观看 | 成人精品一区二区三区中文字幕 | 久久久久久久一区二区 |