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

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

Comments

memtkmcc’s picture

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.

andreiashu’s picture

+1 Good ideea

giorgio79’s picture

Version: 5.x-1.x-dev » 6.x-1.x-dev

+1

mikeytown2’s picture

does the normal drupal cache pick up rss feeds?

giorgio79’s picture

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

mikeytown2’s picture

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.

giorgio79’s picture

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 :)

mikeytown2’s picture

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.

dave reid’s picture

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

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new7.73 KB

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
mikeytown2’s picture

StatusFileSize
new8.44 KB

bug fix has been committed.

new patch incorporating new rules on the performance page.

mikeytown2’s picture

Status: Needs review » Fixed

committed

Status: Fixed » Closed (fixed)

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