Pretty simple question: which one of these two PHP (version 5+) header call is the "best"?
header('Not Modified', true, 304);
header('HTTP/1.1 304 Not Modified');
I'm pretty sure the first one is the most polyvalent one, but just curious if PHP would "fix" the second one if under HTTP 1.0...
Thanks!
Edit: One of these header crashes...
I have cacheable dynamic content made in PHP 5.1.0+. I already send the correct headers (including Last-Modified and ETag) to clients.
I now want my script to be able to answer $_SERVER['HTTP_IF_MODIFIED_SINCE'] and $_SERVER['HTTP_IF_NONE_MATCH'] when present. When the conditions matches, I want to answer a HTTP 304 "Not Modified" to cl...
I have a php script that generates a pdf report. When we go to save the pdf document, the filename that Acrobat suggests is report_pdf, since the php script is named report_pdf.php. I would like to dynamically name the pdf file, so I don't have to type the appropriate name for the report each time that I save it.
Asking on a news group...
Hi,
I am building facebook app using iFrame (using Google App Engine Java,JSP and Facebook-api-java), and when Facebook calls back to my website, I expect to get the fb_sig_* request params for the iFrame, but I get those params in HTTP referer header instead.
When I use the php client, i get the fb_sig_* in the $[_GET] as expected.
W...
After searching a lot, reading every tutorials I've found and asking some questions here, I've finally managed to answer corrctly (at least I think) to if-none-match and if-modified-since HTTP requests.
To do a quick recap, this is what I do on every pages cacheable:
session_cache_limiter('public'); //Cache on clients and proxies
sessi...
I would like to not cache my aspx pages anywhere. For some reason IE ignores meta tags which are set from my master page
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
I am trying to see if I can set my Http response header to "Cache-Control" -...
Currently my IIS is serving CSS files with no Content-Type header.
How to change it?
Should I change it on my application or in the server?
...
Hello all,
This is my first post here, so I hope that I am posting this question the right place. Otherwise, please let me know so that I know for next time I post here :)
I am working on a RoR website and would like to handle server errors (400, 404, 500, etc.) individually. Also, since the website is dynamic I would like to handle th...
My page needs to know when the cache a included javascript file will expire, to retrieve it again.
...
First, a little background. I have written a custom HTTP compression module for ASP.NET. My development machine has Windows 7 Ultimate, which comes with IIS7. My production environment uses IIS6.
The problem I'm having is, Resource Expert Droid (redbot.org) tells me that I need to add a header to my response to properly support compress...
I am working on my and I am struggling to work out how to send PUT and DELETE arguments in PHP.
In a few places I have seen people using the options:
$this->option(CURLOPT_PUT, TRUE);
$this->option(CURLOPT_POSTFIELDS, $params);
Annoyingly, this seems to do nothing. Is this the correct way to set PUT parameters?
If so, how do I set ...
Is there a particular order in PHP to set HTTP headers with the header() function ?
I mean for example must I call header('Content-Language: en'); before header('Content-Type: text/plain'); or whathever order will be OK.
My guess is that order isn't important as long as all he headers are set before any content outputted, but I just wa...
If you look at the PHP doc help for function session_cache_limiter(), you will see that if the cache_limiter parameter is set to private or nocache the Expires HTTP header is set to a const date (Thu, 19 Nov 1981 08:52:00 GMT). I understand that this is a date in the past to avoid caching, but why this date/time in particular? It's not t...
I wrote a python script to process some data from CSV files. The script takes between 3 to 30 minutes to complete, depending on the size of the CSV.
Now I want to put in a web interface to this, so I can upload the CSV data files from anywhere. I wrote a basic HTTP POST upload page and used Python's CGI module - but the script just time...
Hi
I'm using the following simple PHP proxy script but am getting a sporadic message at the destination site.
I'm thinking that perhaps it may have something to do with the HTTP_REFERER header, although I'm not explicitly defining it.
Can anyone tell me how to explicitly turn off or leave the HTTP_REFERER header blank?
Thanks in advan...
I use PHP 5.2.9.
To see/log errors, at the beggining of my script I have:
error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 'On');
ini_set('log_errors', 'On');
ini_set('error_log', $_SERVER['DOCUMENT_ROOT'] . '/php.log');
But when I use the first of the next two lines, my script issue a HTTP 500 error, and nothing is displ...
I ask this question for the comment of this answer:
http://serverfault.com/questions/104648/is-this-http-servers-issue/104679#104679
EDIT
I missed an important point,should also keep the connection not closed.
You guys can smell I'm trying to figure out how long polling actually works.
...
What does the following HTTP 1.1 header means?
If-None-Match: *
I understand it when using a strong or weak ETag or even a list of ETags, but I don't understant it's use when using star (*).
Edit: Would be nice to have some pseudocode (PHP code good also) that would show how/what to answer to "If-None-Match: *".
...
Hi there
I was wondering if you could help me, Im trying to set an expiration date on the caching of certain files in my website, are there some tips you could give me how to do that? Ive been able to find some things on how to change entire file types, but not SPECIFIC files. Is that possible?
ExpiresActive On # enab...
Hello,
I want to ask this question because the php documentation doesn't mention it
How would one put xml data and binary data together?
$imagecontent = @file_get_contents($imagelocation);
$xmldata ="<xml></xml>";
$headers = array("MIME-version: 1.0");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_HTTPHEADER,...