]> git.mxchange.org Git - shipsimu.git/blobdiff - inc/classes/main/response/class_HttpResponse.php
Extended headers added
[shipsimu.git] / inc / classes / main / response / class_HttpResponse.php
index 05e6f987cf659ca54c4639d52806628649f287cd..dea248185cd33cf0e886768c13ad1a8000ba67e7 100644 (file)
@@ -20,6 +20,9 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * The extended headers are taken from phpMyAdmin setup tool, written by
+ * Michal Cihar <michal@cihar.com>, licensed under GNU GPL 2.0.
  */
 class HttpResponse extends BaseFrameworkSystem implements Responseable {
        /**
@@ -126,6 +129,22 @@ class HttpResponse extends BaseFrameworkSystem implements Responseable {
                } elseif (!headers_sent()) {
                        // Send headers out
                        header("HTTP/1.0 {$this->responseStatus}");
+
+                       // Used later
+                       $now = gmdate('D, d M Y H:i:s') . ' GMT';
+
+                       // General header for no caching
+                       header('Expires: ' . $now); // rfc2616 - Section 14.21
+                       header('Last-Modified: ' . $now);
+                       header('Cache-Control: no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
+                       header('Pragma: no-cache'); // HTTP/1.0
+
+                       // whether to show html header?
+                       if ($action != 'download') {
+
+                       // Define the charset to be used
+                       header('Content-Type: text/html; charset=utf-8');
+
                        foreach ($this->responseHeaders as $name=>$value) {
                                header("{$name}: {$value}");
                        }