Link prefetching is used to identify a resource that might be required by the next navigation, and that the user agent SHOULD fetch, such that the user agent can deliver a faster response once the resource is requested in the future.
<link rel="prefetch" href="http://www.example.com/images/sprite.png" />
<link rel="prefetch" href="/images/sprite.png" />
- MSIE 11+/Edge
- Firefox 3.5+ (for HTTPS)
I’ve done a lot of front-end java coding over my career, one particularly annoying aspect is the wait for a build (compile-deploy) cycle in my local developement servers to view or test a small change. One particularly useful tool that I’ve been using for some time is a FileSync plugin for Eclipse. It is useful as you can “map” folders from your Eclipse project to a path on your local filesystem, as such the individual files are automatically copied to your server installation. I’ve personally used this approache with JBoss, Tomcat and WebSphere, but there is no reason that it should not work for other servers.
In these examples, I have used the OpenDNS servers, please change as appropriate.
sudo vi /etc/network/interfaces
auto l0 eth0
iface lo inet loopback
iface eth0 inet static
dns-nameservers 18.104.22.168 22.214.171.124
sudo vi /etc/resolv.conf
NOTE: I’m not 100% sure if this is required!
Add appropriate content, example:
sudo restart networking
sudo ifdown eth0 && ifup eth0
Obviously “Cookies” have a lot of advantages in web applications to maintain “state”, unfortunately using standard server configurations leads to even static content serving them up un-necessarily wasting some (minimal) bandwidth.
Adding the following to the Apache httpd.conf file is a start:
Header unset Cookie
I’ve previously written on the benefits of static analysis of java code with the use of PMD and FindBugs. I was recently turned on to a new tool that performs similar testing of code within the Eclipse IDE.
When I first found this tool it was free, since that time it’s come out of beta and is now a little costly, but it may still be worth it due to the functionality it provides.
The premise of this tool is a little different than other ones, while it covers much of the same need, it also performs many tests that I would previously use CheckStyle to do. This only provides them at runtime and in a common manner within the IDE.
This is a HUGE topic, I’ve outlined some simple steps below as well as my initial configuration for you to start with…
NOTE: this is for simple ‘static’ content such as images, additional work is required for dynamic (program generated) content, such as that generated in PHP.
1. In ‘httpd.conf’ make sure the following line is uncommented.
LoadModule expires_module modules/mod_expires.so
2. In ‘httpd.conf’ add the following:
### Expire images 1 day from when they’re accessed
ExpiresByType application/java-archive “access plus 1 day”
ExpiresByType image/gif “access plus 1 day”
ExpiresByType image/png “access plus 1 day”
ExpiresByType image/jpg “access plus 1 day”
ExpiresByType image/jpeg “access plus 1 day”
ExpiresByType image/x-icon “access plus 1 day”
ExpiresByType text/css “access plus 1 day”
ExpiresByType text/xml “access plus 1 day”
ExpiresByType application/xml “access plus 1 day”
ExpiresByType text/plain “access plus 1 month”
3. (Optional) Set default expiry of content in ‘httpd.conf’:
### Expire everything else 1 day from when it’s last modified
ExpiresDefault “modified plus 1 day”
NOTE: These we’re my original settings, you may want to add attitional MIME type and expiry configurations particular to your web content.