SEO optimizations of XWiki

Last modified by matto on 2018/05/23 10:48

 

Enable tomcat gzip compression

This allows your pages to be have smaller size.

vi /etc/tomcat8/server.xml

   <Connector port="8080" protocol="HTTP/1.1"
                ...
                maxHttpHeaderSize="8192"
                maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
                enableLookups="false" redirectPort="8443" acceptCount="100"
                connectionTimeout="20000" disableUploadTimeout="true"
                compression="on"
                compressionMinSize="1024"
                noCompressionUserAgents="gozilla, traviata"
                compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/javascript"


        />

Remove " - XWiki" title suffx

Every XWiki page has this suffix, which might be good to promote XWiki as great platform, but I'm removing it and would rather promote XWiki the other way.

cd /usr/lib/xwiki/skins

Navigate to the folder of the skin you use (I use flamingo skin):

cd flamingo

Edit file with HTML header 

vi htmlheader.vm

Find this block and add line in bold:

    ## ---------------------------------------------------------------------------------------------------------------
    ## Compute the title.
    ## ---------------------------------------------------------------------------------------------------------------
    #if(!$title)
      #set($title = $!xwiki.getSpacePreference('title'))
      #if($title != '')
        ## Evaluate the title since it can have velocity code.
        #set($title = "#evaluate($title)")
        #set($title = $title.replace(' - XWiki',''))
        ## Don`t forget to escape it.
        #set($title = "$escapetool.xml($title)")
      #else
        #set($title = "XWiki - $escapetool.xml($!doc.space) - $escapetool.xml($!tdoc.displayTitle)")
      #end
    #else
      #set($title = $escapetool.xml($title))
    #end 

This will replace XWiki title suffix 

Enabling rendering cache

This should make pages load a little bit faster.

vi /etc/xwiki/xwiki.properties

Make sure that these values are set:

core.renderingcache.enabled=true

core.renderingcache.duration=300

Tags:
Created by matto on 2018/05/23 10:24
    
CodeGravity.com ©
Web
Analytics Made Easy - StatCounter