Hi, I''ve changed the location of the cache files in Typo. It was putting all of the files in the public folder and this seemed to cause issues with blog serving wrong files. /config/environment.rb After the last line in the above file I added: ActionController::Base.page_cache_directory = "cache" This puts all of the cached files in a new folder, /cache and gets them out of the public folder. Does this help with the caching? --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/instantrails-users/attachments/20051116/ae659d79/attachment.htm
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 E Gard wrote:> Hi, > > I''ve changed the location of the cache files in Typo. It was putting all > of the files in the public folder and this seemed to cause issues with > blog serving wrong files.This is normal behaviour, or supposed to be; caching is done by the webserver serving files directly without calling the scgi/rails environment. Changing that does not help with caching unless some other fancy rewriiting rules are used. (If possible) How is it serving the wrong files? - -- David Morton Maia Mailguard - http://www.maiamailguard.com Morton Software Design and Consulting - http://www.dgrmm.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDfF5CSIxC85HZHLMRAubtAJ9REyQ2n6pj8w2YnXExi+31aM/1aACffs1A HsiZjjsEPhn4YAS9rgHbMq8=MMKT -----END PGP SIGNATURE-----
Hi David, Currently, at the top of my cache folder are the following folders/files: articles (folder) images (folder) stylesheets (folder) index.html Before the change, like above, a cached index.html file was stored in the app''s public folder and served up even when there were new posts to the blog. It was driving me crazy, the site seemed to frozen in time. This occurred back in Typo 2.5.6 and may not be the case any more. Another thing I like about having ALL of the cache file in one place is that I can delete them by hand and not worry about deleting something needed by the blog. I''m also going to add the cache folder to the list for no SCGI, just in case that might be an issue. This may not be needed, but its my nature. Please post any updates on the caching issues. I''m not up to speed on the rewriting rules or apache, in general. Love to learn more. David Morton <mortonda at dgrmm.net> wrote: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 E Gard wrote:> Hi, > > I''ve changed the location of the cache files in Typo. It was putting all > of the files in the public folder and this seemed to cause issues with > blog serving wrong files.This is normal behaviour, or supposed to be; caching is done by the webserver serving files directly without calling the scgi/rails environment. Changing that does not help with caching unless some other fancy rewriiting rules are used. (If possible) How is it serving the wrong files? - -- David Morton Maia Mailguard - http://www.maiamailguard.com Morton Software Design and Consulting - http://www.dgrmm.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDfF5CSIxC85HZHLMRAubtAJ9REyQ2n6pj8w2YnXExi+31aM/1aACffs1A HsiZjjsEPhn4YAS9rgHbMq8=MMKT -----END PGP SIGNATURE----- _______________________________________________ Instantrails-users mailing list Instantrails-users at rubyforge.org http://rubyforge.org/mailman/listinfo/instantrails-users --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/instantrails-users/attachments/20051117/2bfaf92e/attachment.htm
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Here''s my understanding of why things are the way they are: Rails page caching is done by having rails generate the html page and depositing them in the normal DocumentRoot of you web server. When a cached page is hit, it is a simple static page from the webserver... no rewriting is done (except to add .html to the filename internally) and no scgi or rails code is even touched. This is accomplished via the rewrite rules: RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /dispatch.cgi?$1 [QSA,L] 1 It maps the url to a .html file, 2 Tests if it exists, 3 and runs rails if it doesn''t exist. (that line was for fcgi, but it''s the same for scgi (with one caveat that is being worked on)) If you move the cache folder, then those files never exist, and page caching will not work. (note: fragment and action caching are different and their cache files are stored elsewhere. see: http://api.rubyonrails.com/classes/ActionController/Caching.html ) You could move the DocumentRoot of your webserver to your cache directory, but then you''d have to move everything else too, to no net change. As for the site being frozen in time... When something changes, a sweeper process goes through and deletes the files, forcing a fresh run of rails. I saw some stale pages, but they always came up right when I held shift and clicked reload. I suspect the problem is that the web browser is caching the file... so it''s probably not a problem with rail. check your production log in log/ and you should see some mentions of sweeping; that is rails deleting the stale cache files, and should happen whenever data changes. Oh, on typo 2.6.0, there a clear cache on the admin page. :) E Gard wrote:> Hi David, > > Currently, at the top of my cache folder are the following folders/files: > > articles (folder) > images (folder) > stylesheets (folder) > index.html > > Before the change, like above, a cached index.html file was stored in > the app''s > public folder and served up even when there were new posts to the blog. > > It was driving me crazy, the site seemed to frozen in time. > > This occurred back in Typo 2.5.6 and may not be the case any more. > > Another thing I like about having ALL of the cache file in one place is > that I can > delete them by hand and not worry about deleting something needed by the > blog. > > I''m also going to add the cache folder to the list for no SCGI, just in case > that might be an issue. This may not be needed, but its my nature. > > Please post any updates on the caching issues. I''m not up to speed > on the rewriting rules or apach! e, in general. Love to learn more.- -- David Morton Maia Mailguard - http://www.maiamailguard.com Morton Software Design and Consulting - http://www.dgrmm.net -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDfM8ISIxC85HZHLMRAgXiAJ46cVaWhFl4YusDVcGs5zlumGi8RgCeOHcl 4HZzr96Ohvbd5N5cZ53b6ck=PrR/ -----END PGP SIGNATURE-----