6 Replies Latest reply on Jan 31, 2008 5:36 PM by rmonge

    New HTTP caching tool problems

      I have been playing with Anonymous Page Cache in 1.9 and a few other new caching features like the compressionFilter and maxAgeFilter.  I've very happy to see that you are improving the cache-ability of clearspace.  Especially considering the standar 90% anon viewing 10% active user ratios that are often quoted.


      I had a few issues

      1) My log is filled with anonymous authentication exceptions when anonymous users come to site. It makes debugging a difficult and I know i could filter it out in log settings but it seems like there should be a better way.


      2008.01.11 00:01:46 Invalid username/password.
      javax.naming.AuthenticationException: Invalid username/password.
              at sun.reflect.GeneratedConstructorAccessor59.newInstance(Unknown Source)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
              at com.jivesoftware.util.Errors.failIf(Errors.java:32)
              at com.jivesoftware.spi.user.impl.db.AuthenticationProviderImpl.login(AuthenticationProviderImpl.java:38)
              at com.jivesoftware.base.AuthFactory.authTokenFromAuthProvider(AuthFactory.java:367)
              at com.jivesoftware.base.AuthFactory.createAuthToken(AuthFactory.java:315)
              at com.jivesoftware.base.AuthFactory.getAuthToken(AuthFactory.java:180)
              at com.jivesoftware.community.web.filter.JiveCacheFilter.doFilter(JiveCacheFilter.java:177)



      2) I wanted to compress all of my javascript but setting the jive.compressionFilter.contentTypes property doesn't compress application/x-javascript files.

      Using curl:

      curl -D headers.out --compress http://myapp/clearspacex/themes/custom/resources/overlay.js

      HTTP/1.1 200 OK

      Server: Apache-Coyote/1.1

      Set-Cookie: JSESSIONID=42ADDA61D92FFF2A7B9B3FD4BF6C07DF; Path=/home

      Cache-Control: max-age=180000

      Last-Modified: Thu, 10 Jan 2008 06:52:42 GMT

      Etag: "1.9.0-f884c373c5edc834d9b9516b4bff2fda-3309"

      Content-Type: application/x-javascript

      Content-Length: 3309

      Date: Fri, 11 Jan 2008 05:21:46 GMT


      Files of type text/javascript compress fine is there a reason application/x-javascript won't compress?


      2) I wanted to use the maxAgeFilter for avatars but it looks like you already add

      max-age=60 in the image server


      and this didn't seem to work (any suggestions)?






      3) Your web.xml had the wrong path from feeds in for the compressionFilter.

              <url-pattern>/feeds/*</url-pattern>  It should be <url-pattern>/community/feeds/*</url-pattern> 



      4) maxAgeFilter didn't cover themes, we've done custom themes and most of js files live there.  It would be nice if these were defaulted.





      5) I wanted to move some of the anon page caching up further (apache proxy cache) but it seems that each anon user gets a session and has the fact that they are an anonymous user in the session (ANONYMOUS_USER_ID = -1).  Why do anon users need a sessions (if we disable anonymous actions)?  Would it make sense to set an cookie with an anon value so that apache or other front end webservers could do the anon page caching based on the cookie value?



        • Re: New HTTP caching tool problems

          I also noticed that the ETag strategy was different between the themes resource loader and the /styles resource loader.



          Etag:     "1.9.0-6c2dce2b430368dd2bdc4bbc938dd331-17800"



          Etag:     W/"75297-1198884190000"

          • Re: New HTTP caching tool problems

            For some reason if jive.pageCache.enabled=true and when users are on IE 6 or 7 they can cause a blank page to be cached for the page cache length.  This happens when a user hits refresh quickly after the page has loaded once.  This blank page is cached for all anon users.  I'm think that maybe since the response connection could be broken by the user that the cache thinks that it has all of the content but it doesn't.


            We can't reproduce on FF. 


            app server: tomcat 6.0.14

            CS X : 1.9 (with some customizations but nothing that would affect the caching).

            • Re: New HTTP caching tool problems


              Hi Roberto,






              1)  This seems like a bug to me.  I'll see what we can do to fix it.






              2)  Javascript files of type application/x-javascript should work.  Any chance the resource loader mapping has changed in web.xml?






              2a)  maxAgeFilter won't work for avatars as that value is set in the Avatar Servlet.  I'll do some checking to see if there is another way to configure it.






              3)  Yep, your right.  We'll fix the compressionFilter url pattern for feeds.






              4 and 5)  I'll look into these some more.


















                • Re: New HTTP caching tool problems





                  I've got some updated info on a couple of these.






                  1)  I spoke with a developer about this, and the feeling is that there are times when it may be useful to see all of these exceptions.   However, there



                  may be a way to reduce the number of these logged exceptions in Clearspace 2.0.






                  2a)  After looking at this a little more, I found it works, after all.  Use "avatar" instead of "avatars" in your mapping.






                  3)  Fixed in Clearspace 1.10.2






                  4)  Added to Clearspace 1.10.2



                    • Re: New HTTP caching tool problems

                      Ok thanks.


                      My main problem with #1 is that if i get a big traffic spike of new 

                      to the site users (lets say 200K) this log line would be quite a 

                      spike in errors (which we monitor) and that would send a wave of 

                      alarms for something that is expected (new users).


                      Thanks for moving these changes to the next release.

                      • Re: New HTTP caching tool problems
                        Jody wrote:


                        2a)  After looking at this a little more, I found it works, after all.  Use "avatar" instead of "avatars" in your mapping.


                        I tried that in tomcat 6 and I still didn't get the max-age added to avatars.  I've been doing some load testing and the avatars seem to be putting a good amount of load on our app server since they are dynamically sized on the fly.