anikesh / web-optimizator

Automatically exported from code.google.com/p/web-optimizator
0 stars 0 forks source link

[XML] Improve the performance by serving feeds as static (XML) files #501

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In my testing with web-optimizator I note that there is minimal effort to ease 
the CPU load of feeds = xml, rss, rss2, rdf, atom or podcast.

For me, the preferred solution would be that webo creates cached static assets 
for feeds. The current Wordpress Super Cache does this - with some custom 
changes, as does W3 Total Cache.

For now - Web-optimizator does at least 'cache' the database SQL for this 
request, but it is NOT yet a static resource. It should become a static asset 
treated similar to static html.

Original issue reported on code.google.com by peterbowey on 1 Jan 2011 at 2:06

GoogleCodeExporter commented 9 years ago
Solution for FEED (static + caching):

Edit /controller/compressor.php as per:

--------------------------------------------------------------------------------
---
# line 575 #    if (strpos($header, 'text/html') || strpos($header, 
'application/xhtml+xml') || strpos($header, 'text/xml')) {

# line 606 #    //              strpos($spot, '<rss') !== false ||                // 
Allow RSS
# line 607 #    //              strpos($spot, '<feed') !== false ||               // 
Allow FEED
--------------------------------------------------------------------------------
---

For Nginx edit /controller/admin.php as per:

--------------------------------------------------------------------------------
---
# line 5137 # //        if (in_array('mod_rewrite', $apache_modules)) {
            $this->apache_modules[] = 'mod_rewrite';             // required for our Nginx
# line 5139 # //        }
--------------------------------------------------------------------------------
---

Notes: The above edit applies to web-optimizator 1.4.0b SVN Release = r2868

With the above changes web-optimizator now generates static feeds as 
per(Wordpress):

/feed/index.ie6.html.df
/feed/index.ie7.html.df
/feed/index.ie8.html.gz
/feed/index.ie9.html.gz
/feed/index.html.gz
/feed/index.html

If you wonder why ie9 is included - it is because I have coded both Nginx and 
web-optimizator to process it as a separate user_agent. Tested with 
http://www.webpagetest.org/ - as per various UA's.

Original comment by peterbowey on 3 Jan 2011 at 11:44

GoogleCodeExporter commented 9 years ago
Post Notes:

1) # line xxx #   => designates code line numbers (only)
2) //             => designates code commented out - per '//'

Original comment by peterbowey on 3 Jan 2011 at 11:54

GoogleCodeExporter commented 9 years ago
RSS feeds can be hardly added, because standard minify rules are applied to 
them as well. Need to think how to separate all optimization just for HTML 
contents and for XML ones.

Original comment by sunny.dr...@gmail.com on 16 Jan 2011 at 8:18