Hot answers tagged

6 votes

How to use drush with proxy

Drush by default is using wget to download project (if available), otherwise curl. This can be change by --package-handler. You can check which package handler is in place by running your command with ...
  • 13.7k
5 votes

Drupal behind a SSL offloading reverse proxy -- is this config correct?

You don't have to indicate $base_url = 'https://staging.example.com'; , you can have something like this: server { listen 80; server_name staging.example.com; return ...
5 votes

How to correctly configure settings.php to use reverse proxy and ssl termination

This should work for both Drupal 7 and 8. It's actually the global.inc for one of my Aegir set-ups, which gets injected into all hosted sites' settings.php files. <?php # global settings.php /** ...
  • 1,990
4 votes

Varnish and page cache

As answered by @dicix, Drupal will not return the correct Cache-Control headers to Varnish without "Page Cache" being enabled in the Drupal Performance configuration. The problem I ran into with ...
4 votes
Accepted

Module to cache URLs commonly request by bots?

You can alter the fast404 code inside of setting.php to handle this. It will handle *.asp & *.pl; changing the regex so it handles paths like /postnuke/article.php /wp-content/ /mailman/ /...
  • 8,242
4 votes

How to purge cached content every day via cache tag?

Here is the code that flush cache on first hit of a day: public function build() { ... ... ... $this->handleCacheTag($build['#cache']['tags']); } protected function ...
  • 2,224
3 votes

Multiple login attempts from different IP Addresses

You can use Rename Admin Paths module to override the admin path. This module allows you to: rename path like '/admin/...' to '/something/...' rename path like '/user/..' to '/something else/..' ...
3 votes

How can I clear the Varnish cache?

You may install Varnish HTTP Accelerator Integration module and set the following lines in your settings file: /** * Varnishd Configuration * * This cache implementation can be used together with ...
  • 13.7k
3 votes
Accepted

Can't login with varnish enabled

The offending parts in your VCL are (line 53): # Drop any cookies sent to Drupal. if (!(req.url ~ "install\.php|update\.php|cron\.php|admin\.php")) { unset req.http.cookie; } and (line 81): # ...
  • 2,244
3 votes

Cache max-age and varnish ESI

max-age 60s is pretty low for the frontpage. Does the data really update that frequently or is it just that it could update but usually it doesn't happen every minute? One possible approach to solve ...
  • 81.7k
3 votes
Accepted

Where to use setTrustedProxies() or how to set new trusted proxies

Drupal doesn't want you to place custom code in index.php to prepare a request before it is handled by the Drupal kernel. So it was made possible for modules to implement a middleware through ...
  • 90.3k
3 votes
Accepted

How to set up Drupal behind a proxy correctly?

The problem has to do with how cookies are associated with domains. After you log into a Drupal site, Drupal sends a cookie to the browser that it uses in future requests to show it has been ...
2 votes

Avoid caching pages for authenticated users with Varnish

In your settings.php are you using $conf['omit_vary_cookie'] = TRUE; ? If so, logged in users who have previous viewed a page when logged out will be served the varnish cached version of their page ...
2 votes

How can I clear the Varnish cache?

For running Drupal 8 websites using Varnish Cache, install the Purge module. Purge will manage the Varnish Cache from Drupal 8 admin unless you need to support Cache Tags. To Support Cache Tags with ...
  • 108
2 votes
Accepted

Private files not found 404 error

Ok, I got this issue fixed. The Vanish installed on server was causing the issue more specifically the following code. # Always cache the following file types for all users. if (req.url ~ "(?i)\...
  • 198
2 votes

Why does my site whitescreen with content?

For dev enviroment you can follow the instructions of the sites/example.settings.local.php Local development override configuration feature. To activate this feature, copy and rename it such ...
  • 3,541
2 votes

Why does my site whitescreen with content?

Drupal 8 is still in beta so things are still going to be rough there. WSOD's are usually a symptom of some PHP error being hidden by the web server (many default PHP setups don't advertise errors). ...
  • 26.4k
2 votes

Varnish has no SSL support; then what to use?

Content delivery platforms like CloudFlare and Fastly offer a wide range of SSL/TLS options. The question is, what are you trying to accomplish? Note that Varnish really won't do you any good for high ...
  • 3,622
2 votes
Accepted

Stop Varnish from caching 302 redirect from POST responses

Disable caching in fetch if response status is 302 sub vcl_fetch { set beresp.grace = 24h; if (beresp.status >= 400) { return (hit_for_pass); } // New Set Longer Cache if (req.http.user-...
  • 151
2 votes

Autcache + Varnish modules installed but cache tables growing

Varnish should not ideally affect your cache tables, not sure about auth_cache. You should try the reverse approach to figure out what is wrong, check which of your cache tables is growing abnormally ...
  • 481
2 votes

Need help optimizing a site for speed and response time

You can use both as per my knowledge. For Drupal generally, Varnish works for unauthenticated users traffic and memcached will cache authenticated users traffic. Memcache saves your DB from doing a ...
  • 7,183
2 votes

Varnish doesn't cache first hit at all, only second hit

It looks like a normal behaviour : first url hit : Varnish puts the page in cache with some id only following hits will serve the cached id instead of querying the backend. If you want anonymous ...
  • 3,472
2 votes
Accepted

How to get cache tags invalidation working with Varnish Purger

So, it was an error in the settings of the purger from the purge module. That became clear after asking this question on Stackoverflow. Automated Cron or Drush were not able to connect to Varnish on ...
  • 227
2 votes

Reverse proxy and auto_complete with mixed content

Try to set X-Forwarded-* headers in the Apache reverse proxy: <VirtualHost *:443> ServerName www.mydomain.be ServerAlias mydomain.be NameVirtualHost www.mydomain.be ...
  • 90.3k
1 vote
Accepted

Varnish + Adaptive Theme

Do you perhaps use Context Breakpoint? I had a similar experience using that module. The module states the following on its project page: Caching implications This module has implications for ...
  • 8,239
1 vote
Accepted

Drupal 8 css and images relative to root

Core actually did exactly that change just a few days ago, it will be like that in 8.0.3. That said, your set up looks problematic to me, that's not going to be the only thing that somehow relies on ...
  • 81.7k
1 vote

Bluehost cloud hosting, varnish caching issue authenticated user

Just to add that varnish only work for anonymous user not for authenticated. There are various module available to purge varnish cached data on a particular event such as node insert, update, delete ...
1 vote
Accepted

Access denied at password reset page when logging in

Comment out the /* $cookie_domain = $_SERVER['HTTP_HOST']; */ from settings.php from the path \sites\defaults will work for you. or else use the below code in settings.php: <?php /** * Drupal ...
  • 394
1 vote

Cache-Control: no-cache despite allowing cache for anonymous users

Inspect your HTTP headers and see if session or other cookies are being set. This is the most common cause of Varnish "not working." Also make sure you are not logged in, and you can test using http://...
  • 541

Only top scored, non community-wiki answers of a minimum length are eligible