Static Feed Caching

kus - October 11, 2007 - 16:03
Project:Boost
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Most of the traffic on my website is from the feeds (70%...podcasts).

I'd like to see static feed caching in the future.

#1

emaylx - December 19, 2008 - 00:02

I vote for caching RSS also, because it IS possible to send static files with required header:

Content-Type: application/rss+xml

or

Content-Type: text/xml

when using Nginx webserver.

I plan to share my full Drupal+Boost+Nginx working configuration, soon, and adding cache for RSS (even for Nginx users) would be huge benefit.

#2

andreiashu - December 21, 2008 - 11:56

+1 Good ideea

#3

giorgio79 - May 19, 2009 - 03:08
Version:5.x-1.x-dev» 6.x-1.x-dev

+1

#4

mikeytown2 - May 19, 2009 - 17:36

does the normal drupal cache pick up rss feeds?

#5

giorgio79 - May 21, 2009 - 06:27

mikeytown2: Here is a related "answer" :) http://drupal.org/node/231424

#6

mikeytown2 - May 21, 2009 - 07:53
Status:active» postponed (maintainer needs more info)

hmmm... What are all the possible url structures for feeds? Fairly sure it would have to support application/rss+xml & text/xml content-type mimes. In short a spec sheet is needed, so the degree of difficulty can be assessed.

#7

giorgio79 - May 21, 2009 - 13:57

with pathauto if you look int he pathauto table, every feed enabled stuff gets a "/feed" added to the end by default. At least for me for sure :)

#8

mikeytown2 - June 1, 2009 - 09:05
Status:postponed (maintainer needs more info)» active

We can use the same boost commented footnote, so need to change the // Output buffering callback to correctly detect html & xml. Rewrite rules need to push out text/xml; (T=MIME-type) or ForceType. Cache all .xml extensions, all /feed paths. Add a setting to control this.

#9

Dave Reid - June 4, 2009 - 23:17

FYI The URL requests for XML sitemap data are always going to be /sitemap(-\d+)?\.xml/i (PHP's preg format).

#10

mikeytown2 - June 8, 2009 - 04:54
Status:active» needs review

Fixed a bug with url aliass & subdir in this patch in boost_cache_expire_derivative() function. Patch should cache xml and feeds.

Rules

  # BOOST START
  <FilesMatch "\.(html.gz|html)$">
    <IfModule mod_headers.c>
  Header set Expires "Sun, 19 Nov 1978 05:00:00 GMT"
      Header set Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0"
    </IfModule>
  </FilesMatch>
  <IfModule mod_mime.c>
    AddCharset utf-8 .html
  </IfModule>
  <FilesMatch "\.(html.gz)$">
    AddEncoding x-gzip .gz
    ForceType text/html
  </FilesMatch>
    <FilesMatch "\.(xml.gz)$">
    AddEncoding x-gzip .gz
    ForceType text/xml
  </FilesMatch>
  #serve file IF it exist on server
  RewriteCond %{REQUEST_FILENAME} \.\w{2,4}$
  RewriteCond %{REQUEST_FILENAME} -f
  RewriteRule .* - [L]
 
  #skip boost IF not get request OR uri has wrong dir OR cookie is set
  RewriteCond %{REQUEST_METHOD} !^GET$ [OR]
  RewriteCond %{REQUEST_URI} (^/(admin|cache|misc|modules|sites|system|themes|user/(login|password|register)))|(/(comment/reply|user)$) [OR]
  RewriteCond %{HTTP_COOKIE} DRUPAL_UID
  RewriteRule .* - [S=4]

  #GZIP
  RewriteCond %{HTTP:Accept-encoding} gzip
  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.html.gz -f
  RewriteRule .* cache/gz/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.html.gz [L]
  RewriteCond %{DOCUMENT_ROOT}/cache/gz/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.xml.gz -f
  RewriteRule .* cache/gz/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.xml.gz [L,T=text/xml]
 
  #NORMAL
  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.html -f
  RewriteRule .* cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.html [L]
  RewriteCond %{DOCUMENT_ROOT}/cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.xml -f
  RewriteRule .* cache/%{SERVER_NAME}%{REQUEST_URI}_%{QUERY_STRING}.xml [L,T=text/xml]
  # BOOST END

AttachmentSize
boost-182686.patch 7.73 KB

#11

mikeytown2 - June 9, 2009 - 09:05

bug fix has been committed.

new patch incorporating new rules on the performance page.

AttachmentSize
boost-182686.patch 8.44 KB

#12

mikeytown2 - June 10, 2009 - 02:54
Status:needs review» fixed

committed

#13

System Message - June 24, 2009 - 03:00
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.