How to set response filename without forcing “save as” dialog
The correct way could be: Content-Disposition: inline; filename=”myfile.txt”
The correct way could be: Content-Disposition: inline; filename=”myfile.txt”
When you’re operating a webservice that is accessed by clients, it might be difficult to correlate requests (that a client can see) with server logs (that the server can see). The idea of the X-Request-ID is that a client can create some random ID and pass it to the server. The server then include that … Read more
Introduction If I understand you correctly, you need to identify a user for whom you don’t have a Unique Identifier, so you want to figure out who they are by matching Random Data. You can’t store the user’s identity reliably because: Cookies Can be deleted IP address Can change Browser Can Change Browser Cache may … Read more
Actually, upon further reading on the file_get_contents() function: // Create a stream $opts = [ “http” => [ “method” => “GET”, “header” => “Accept-language: en\r\n” . “Cookie: foo=bar\r\n” ] ]; // DOCS: https://www.php.net/manual/en/function.stream-context-create.php $context = stream_context_create($opts); // Open the file using the HTTP headers set above // DOCS: https://www.php.net/manual/en/function.file-get-contents.php $file = file_get_contents(‘http://www.example.com/’, false, $context); You … Read more
Cross site approach To allow receiving & sending cookies by a CORS request successfully, do the following. Back-end (server) HTTP header settings: Set the HTTP header Access-Control-Allow-Credentials value to true. Make sure the HTTP headers Access-Control-Allow-Origin and Access-Control-Allow-Headers are set. Don’t use a wildcard *. When you set the allowed origin make sure to use … Read more
try this <?php header(“Cache-Control: no-store, no-cache, must-revalidate, max-age=0”); header(“Cache-Control: post-check=0, pre-check=0”, false); header(“Pragma: no-cache”); ?>
You can set specific cache-headers for a whole folder in either your root web.config: <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <!– Note the use of the ‘location’ tag to specify which folder this applies to–> <location path=”images”> <system.webServer> <staticContent> <clientCache cacheControlMode=”UseMaxAge” cacheControlMaxAge=”00:00:15″ /> </staticContent> </system.webServer> </location> </configuration> Or you can specify these in a web.config file in … Read more
Tried this? Should work in both .htaccess, httpd.conf and in a VirtualHost (usually placed in httpd-vhosts.conf if you have included it from your httpd.conf) <filesMatch “\.(html|htm|js|css)$”> FileETag None <ifModule mod_headers.c> Header unset ETag Header set Cache-Control “max-age=0, no-cache, no-store, must-revalidate” Header set Pragma “no-cache” Header set Expires “Wed, 11 Jan 1984 05:00:00 GMT” </ifModule> </filesMatch> … Read more
A 302 redirect means that the page was temporarily moved, while a 301 means that it was permanently moved. 301s are good for SEO value, while 302s aren’t because 301s instruct clients to forget the value of the original URL, while the 302 keeps the value of the original and can thus potentially reduce the … Read more
The only difference is that with Private you are not allowing proxies to cache the data that travels through them. In the end, it all boils down to the data contained in the pages/files you are sending. For example, your ISP could have an invisible proxy between you and the Internet, that is caching web … Read more