I've been using the simplecache plugin for ages now and up until now never experienced any serious problem.
However I experienced something odd now: It seems that if you request the RSS feed with an If-modified-Since header it will *always* reply with "304 not modified".
Just a testcase:
$ curl -I -H "If-Modified-Since: Thu, 01 Jan 1970 00:00:00 +0000" https://s9y.hboeck.de/index.php?/feeds/index.rss2
HTTP/1.1 304 Not Modified
[...]
This disappeared when I disabled the simplecache plugin. I'm running s9y 1.7.8.
Anyone ever seen this before?
(I've just changed the URL to a test installation of mine where I could reproduce it with a minimal s9y installation. If you need backend access to test something please mail me and I'll send you credentials)
simplecache plugin and RSS not modified header
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: simplecache plugin and RSS not modified header
Hm, the plugin was always more of a "proof of concept" that is good in specific scenarios, but has issues.
The logic is quite complex, and I believe the RSS feeds also have specific If-Modified handling. I'm afraid currently I don't have the time that would be needed for such a complicated issue to be resolved because there are other open issues with the 2.0 release that affect more commonly used areas.
If anyone is willing to have a go at this, I'd be happy to lend a hand or try to give feedback, but I can't really offer much help on this. Really sorry.
(I'd rather wanted to post this instead of not answering at all.)
The logic is quite complex, and I believe the RSS feeds also have specific If-Modified handling. I'm afraid currently I don't have the time that would be needed for such a complicated issue to be resolved because there are other open issues with the 2.0 release that affect more commonly used areas.
If anyone is willing to have a go at this, I'd be happy to lend a hand or try to give feedback, but I can't really offer much help on this. Really sorry.
(I'd rather wanted to post this instead of not answering at all.)
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: simplecache plugin and RSS not modified header
Hanno, I tried to debug the respective code a little, but did not dig too deep.
Yet I found something: It looks like there is a problem with your sending the equivalent of the unix timestamp 0. Well, actually not with your header, but with the code that tries to transform the date format into a unix timestamp.
Could you please try to request the feed with another date & time (e.g. …1971)? Do you still get a 304?
Yet I found something: It looks like there is a problem with your sending the equivalent of the unix timestamp 0. Well, actually not with your header, but with the code that tries to transform the date format into a unix timestamp.
Could you please try to request the feed with another date & time (e.g. …1971)? Do you still get a 304?
Re: simplecache plugin and RSS not modified header
Update: This should fix the issue. However, because the function is called quite often, I'm not sure if it has any (negative) side effects. Garvin?
PS: Tested against the latest 2.0 branch, but it's the same in master, I guess.
PPS: Boy, we sure need some unit tests
Code: Select all
--- include/functions.inc.php (revision bbf1456fd8240e922a88e0d60f4e3c968e30b4f9)
+++ include/functions.inc.php (revision )
@@ -62,7 +62,7 @@
function serendipity_serverOffsetHour($timestamp = null, $negative = false) {
global $serendipity;
- if ($timestamp == null) {
+ if ($timestamp === null) {
$timestamp = time();
}
PPS: Boy, we sure need some unit tests
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: simplecache plugin and RSS not modified header
Phew. Well. I honestly don't know. But I'd think that using === should be the actually expected behaviour, so I'd suggest you can commit it to the 2.0 branch. Better not port this to 1.x though.
Regards,
Garvin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Re: simplecache plugin and RSS not modified header
Exactly what I think.garvinhicking wrote:I'd suggest you can commit it to the 2.0 branch. Better not port this to 1.x though.
I've just committed the fix, and I added a very basic unit testcase for it. You should be able to run it by
Code: Select all
$ cp tests/phpunit.xml.dist phpunit.xml
$ phpunit -c tests/phpunit.xml
Mattsches
Re: simplecache plugin and RSS not modified header
I've tested your patch on my blog and it seems alright. I re-enabled caching and behaviour is as expected.
Thanks a lot!
Thanks a lot!