remove CACHE_HTTP - client side page cache causes more problems than it solves
This commit is contained in:
		
							parent
							
								
									3c78b5685e
								
							
						
					
					
						commit
						641fd5a16f
					
				| @ -287,22 +287,6 @@ class BasePage | |||||||
| 
 | 
 | ||||||
|         switch ($this->mode) { |         switch ($this->mode) { | ||||||
|             case PageMode::PAGE: |             case PageMode::PAGE: | ||||||
|                 if (CACHE_HTTP) { |  | ||||||
|                     global $user; |  | ||||||
|                     header("Vary: Cookie, Accept-Encoding"); |  | ||||||
|                     if ($user->is_anonymous() && $_SERVER["REQUEST_METHOD"] == "GET") { |  | ||||||
|                         header("Cache-control: public, max-age=600"); |  | ||||||
|                         header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 600) . ' GMT'); |  | ||||||
|                     } else { |  | ||||||
|                         #header("Cache-control: private, max-age=0");
 |  | ||||||
|                         header("Cache-control: no-cache"); |  | ||||||
|                         header('Expires: ' . gmdate('D, d M Y H:i:s', time() - 600) . ' GMT'); |  | ||||||
|                     } |  | ||||||
|                 } |  | ||||||
|                 #else {
 |  | ||||||
|                 #	header("Cache-control: no-cache");
 |  | ||||||
|                 #	header('Expires: ' . gmdate('D, d M Y H:i:s', time() - 600) . ' GMT');
 |  | ||||||
|                 #}
 |  | ||||||
|                 usort($this->blocks, "blockcmp"); |                 usort($this->blocks, "blockcmp"); | ||||||
|                 $this->add_auto_html_headers(); |                 $this->add_auto_html_headers(); | ||||||
|                 $this->render(); |                 $this->render(); | ||||||
|  | |||||||
| @ -22,7 +22,6 @@ _d("DATABASE_DSN", null);    // string   PDO database connection details | |||||||
| _d("DATABASE_TIMEOUT", 10000);// int     Time to wait for each statement to complete
 | _d("DATABASE_TIMEOUT", 10000);// int     Time to wait for each statement to complete
 | ||||||
| _d("CACHE_DSN", null);       // string   cache connection details
 | _d("CACHE_DSN", null);       // string   cache connection details
 | ||||||
| _d("DEBUG", false);          // boolean  print various debugging details
 | _d("DEBUG", false);          // boolean  print various debugging details
 | ||||||
| _d("CACHE_HTTP", false);     // boolean  output explicit HTTP caching headers
 |  | ||||||
| _d("COOKIE_PREFIX", 'shm');  // string   if you run multiple galleries with non-shared logins, give them different prefixes
 | _d("COOKIE_PREFIX", 'shm');  // string   if you run multiple galleries with non-shared logins, give them different prefixes
 | ||||||
| _d("SPEED_HAX", false);      // boolean  do some questionable things in the name of performance
 | _d("SPEED_HAX", false);      // boolean  do some questionable things in the name of performance
 | ||||||
| _d("NICE_URLS", false);      // boolean  force niceurl mode
 | _d("NICE_URLS", false);      // boolean  force niceurl mode
 | ||||||
|  | |||||||
| @ -405,7 +405,7 @@ class UserPage extends Extension | |||||||
|     { |     { | ||||||
|         global $page, $config; |         global $page, $config; | ||||||
|         $page->add_cookie("session", "", time() + 60 * 60 * 24 * $config->get_int('login_memory'), "/"); |         $page->add_cookie("session", "", time() + 60 * 60 * 24 * $config->get_int('login_memory'), "/"); | ||||||
|         if (CACHE_HTTP || SPEED_HAX) { |         if (SPEED_HAX) { | ||||||
|             # to keep as few versions of content as possible,
 |             # to keep as few versions of content as possible,
 | ||||||
|             # make cookies all-or-nothing
 |             # make cookies all-or-nothing
 | ||||||
|             $page->add_cookie("user", "", time() + 60 * 60 * 24 * $config->get_int('login_memory'), "/"); |             $page->add_cookie("user", "", time() + 60 * 60 * 24 * $config->get_int('login_memory'), "/"); | ||||||
|  | |||||||
| @ -6,7 +6,6 @@ define("DATABASE_DSN", null); | |||||||
| define("DATABASE_TIMEOUT", 10000); | define("DATABASE_TIMEOUT", 10000); | ||||||
| define("CACHE_DSN", null); | define("CACHE_DSN", null); | ||||||
| define("DEBUG", false); | define("DEBUG", false); | ||||||
| define("CACHE_HTTP", false); |  | ||||||
| define("COOKIE_PREFIX", 'shm'); | define("COOKIE_PREFIX", 'shm'); | ||||||
| define("SPEED_HAX", false); | define("SPEED_HAX", false); | ||||||
| define("NICE_URLS", true); | define("NICE_URLS", true); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user