Recently I was browsing a D7 site of ours and ran into a blank screen. I tried refreshing and could not get the page to load. I had to open the page in a new tab to get it to load. After some Googling I found that Safari (including the IOS version) has a bug that causes the browser to show a blank page if the page returns a 304 response. 304 responses are cache-related. I can confirm that on all of our Drupal sites that use caching, the error occurs. All of our sites that do not have caching enabled (mostly development sites) do not have the issue.
It's pretty easy to trigger the error:
- Open Safari and browse to a Drupal site that uses built-in caching mechanisms.
- Click a link on the page.
- Click "Back" button in browser. Refresh.
- Get blank screen.
TIP: you can see the headers in the inspector under Timelines » Network Requests. We're concerned with the "Document" request's status.
Though it may not be the best approach, I'll comment with a small revision to bootstrap.inc that solves the problem (at least in my minimal testing). This is only a bandaid for the Safari bug. Unfortunately it eliminates the page caching altogether for Safari. This isn't ideal, but it's better than white screens.
I'm not going to apply this fix to any sites until I get some feedback on this issue.
Thanks!
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | safari_304_blank_page-2309081-1.patch | 1.27 KB | agileadam |
Comments
Comment #1
agileadamHere's the patch file.
Comment #2
flux423Thanks for the find @agileadam! I've tested this on 3 sites and confirmed that this is a safari bug.
I'll do my best to run the patch and post back the results.
Comment #3
agileadamYeah, I hated to patch core for this bug, but on mission-critical sites I deemed it necessary.
I'm surprised there isn't more activity on this one!
Comment #4
nimoatwoodwayThanks for your patch! Patched against Drupal Core 7.32. Is working! Hopefully this gets into core soon.
Comment #5
flux423Hey @agileadam - can you confirm that this is no longer an issue?
I'm not seeing it anymore using the steps above.
Comment #6
agileadam@flux423,
I haven't seen this issue in some time.
I just tested on a recent launch (unpatched) and did not see the issue.
Did you just experience the issue? If not, we can probably close this out.
Comment #7
flux423I have not seen this issue arise again.
I think we can close this one.
Thanks @agileadam.
Comment #8
flux423