Drupal snippets #1 (Views exposed filters, F5 tweaks)
While I'm certain that I could never work up to the standards of Peter Cooper his "Interesting Ruby Tidbits That Don't Need Separate Posts" series was a great help to me when I was a ruby developer. You can see the original here: IRTTDNSP #1. I've not found similar for the Drupal community but I believe a lot of the things I do during the week are interesting but not at all worthy of a complete post of their own. So this will be my attempt to categorize and commit those very thoughts to memory. I hope that even one of these things sparks something for you.
How to get Views' exposed filters to display in a block
If you create a block display and have some exposed filters you may have trouble getting them to actually show up. The problem is that blocks don't seem to like to display their exposed filters unless two prerequisites are met: there must be a full page display somewhere and it must have a path, the block must be set to use ajax. I would have never guessed this either but if you look at the requests that are going across the wire they're going to that page display and the results are coming back over ajax.
How to reorder taxonomy terms in Views' exposed filters
On that same page we realized that we needed to order the dropdown in a reasonable way in part just to keep people from using it on the awards day to stave off some of the traffic. Analysis of traffic suggests we actually got the ordering wrong but whatever, you just want to know how to reorder taxonomy terms in an exposed filter.
Despite the ordering that Views seems to be suggesting below, the actual display order of terms is determined by the taxonomy weights page at /admin/content/taxonomy/
How to get an F5 Load Balancer to stop putting the Vary headers on your responses
When you're using a CDN like Akamai having a Varies header in your response absolutely kills your caching despite all the hard work drupal puts into getting things right. We were seeing about 50-75% cachability through Akamai because of it. Mostly this was because Akamai couldn't cache the JS/CSS which was clearly incorrect. After we figured out that it was the Varies header (props to Grendzy as usual :P), it was a hop skip and a jump to figure out which settings could be causing the actual problem.
Turns out the Varies header setting isn't the culprit though it does in fact fix the problem we were having it also introduces some others. The culprit is in fact having Browser Workarounds on which fixes IE6 and gzip and not having HTTP/1.0 Requests on. Of course the manual doesn't really describe what's going on so massive props out to spark on the F5 forums for answering this question before I had the chance to ask it.
I've run out of time but I'd be grateful for any feedback. If people don't find this useful I'll not post it on planet but if you do please keep reading and encouraging me with your great comments.
I'm confused about your explanation about the Vary headers. You want vary headers so that browsers that support compression and those that don't all get a cached page. Correct?
Mon, 07/12/2010 - 07:09
@dalin Yes, to some degree this is correct. You want to keep the Vary: Accept-Encoding so that browsers that don't accept gzip won't ask for it, but Vary: User-Agent apparently tells Akamai and Limelight to just pass the request straight on the the origin because it has no idea what to do with it. So yeah, you're right that we really want to keep the Vary header, but in the case of the Vary: User-Agent we have to get rid of it for cache utilization.
Wed, 03/23/2011 - 18:33
Late to the game here, but just for posterity: you can also change your Akamai config so that it ignores Vary entirely. In the "Header Handling Rules" section, set a "Default Rule" to "Ignore Vary headers".
Fri, 08/27/2010 - 02:56
Might you have any suggestions on how to reorder a select list for an exposed filter that comes from a CCK field?
Wed, 12/22/2010 - 23:15
Has anyone worked out how to re-order the items in the exposed select list? I have one that I need to order alphabetically.
Mon, 12/27/2010 - 20:29
You could re-order your allowed values in the CCK field itself, or use hook_form_alter to change the form.
Sun, 07/11/2010 - 01:28