SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
Thread: Headers for dynamic content
-
Oct 22, 2003, 09:41 #1
- Join Date
- Dec 2001
- Location
- Market Harborough, UK
- Posts
- 206
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Headers for dynamic content
Hi,
Part of my website creates pdf files dynamically (using PHP) and displays them in a popup. Unfortunately, I have an issue which is due (I think) to local caching.
What happens is that the first time a page is called up, it works fine. If it is re-called fairly quickly, then you get an instant "page not available" error. The browser doesn't even appear to make the request to to server.
I suspect some sort of local caching issue and was wondering if anyone could tell me what header I need to send with the page to inform the browser that the page is not to be cached.
TIA
Cheers,
PaulLast edited by pauls; Oct 23, 2003 at 04:09.
Paul Simpson, BSc, MCNI, MCNE
-
Oct 22, 2003, 10:27 #2
In PHP:
PHP Code:header("cache-control: no-store");
-
Oct 23, 2003, 02:14 #3
- Join Date
- Dec 2001
- Location
- Market Harborough, UK
- Posts
- 206
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks for that!
Are there any rules as to order of headers?
I now have:PHP Code:pdf_close($p);
$buf=pdf_get_buffer($p);
$len=strlen($buf);
header("Content-type: application/pdf");
header("Content-Length: $len");
header("Content-Disposition: inline; filename=grouplist.pdf");
header("cache-control: no-store" );
print $buf;
pdf_delete($p);
If I take the last header line out, it starts "working" again, but displays the original problem.
I can only assume I'm missing something or that the header order matters....Paul Simpson, BSc, MCNI, MCNE
Bookmarks