The following examples and layouts use the 'overflow:hidden' feature to prevent text wrapping and to allow nice and neat listings whilst keeping them responsive. The examples all comprise of 2 columns. You can either choose to have trhe image on the right or left without issue.
Consider putting the clear both in the <h2> title rather thatn a seperate <div style="clear: both;"> </div> - This makes it neater and one less line. Not having the <div> at the end also prevents the text getting cycled in <div>'s rather than <p>'s.
HTML
<div style="overflow: hidden;"> <img style="margin: 10px; float: right;" src="/images/pages/dog-sitting/arnside.jpg" alt="arnside" /> <p style="overflow: hidden; min-width: 180px;">Your dog can stay with us at my home. They will be treated just like a member of our family with</p> </div>
Item/Article list (ie rooms) image on the left, minimum width for the item to prevent content/text block wrapping and splitting lines (responsive)
HTML
<div style="overflow: hidden;"> <img style="margin: 10px; float: left;" src="/images/pages/home/group-dogs-1.jpg" alt="group-dogs-1" /> <p style="overflow: hidden; min-width: 180px;"> If you’re working full time hours we can call at lunchtime and treat your dog to over an hours’ worth of exercise and companionship to break up the day. If the mornings are hectic or your dog is young and just can’t wait then maybe our morning walk is for you. I walk in the afternoon too giving you real flexibility if you work shifts or have a busy afterschool schedule. Walkies works Mon to Fri but book only the days you need. Five days a week or five days a year, once you have registered I’m happy to take your dog even when it’s a last minute emergency. Weekends are by arrangement.<br style="clear: both;" /> </p> </div>
Item/Article list (ie rooms) image on the left, minimum width for the item to prevent content/text block wrapping and splitting lines (responsive)
HTML
<div style="overflow: hidden;"> <img style="margin: 10px; float: left;" src="/images/pages/home/group-dogs-1.jpg" alt="group-dogs-1" /> <p style="overflow: hidden; min-width: 180px;"> If you’re working full time hours we can call at lunchtime and treat your dog to over an hours’ worth of exercise and companionship to break up the day. If the mornings are hectic or your dog is young and just can’t wait then maybe our morning walk is for you. I walk in the afternoon too giving you real flexibility if you work shifts or have a busy afterschool schedule. Walkies works Mon to Fri but book only the days you need. Five days a week or five days a year, once you have registered I’m happy to take your dog even when it’s a last minute emergency. Weekends are by arrangement. </p> </div> <div style="clear: both;"> </div>
NB: <p style="overflow: hidden; min-width: 180px;"> can be replaced with <div style="overflow: hidden; min-width: 180px;">. This has the benefits of extra spacing that comes with <p> not being applied. However if you use <div>, text will also need to be encapsulated in a <p>. See the following methods.
HTML
<div style="overflow: hidden;"> <img alt="" src="/images/dog-picture.jpg" style="float:left; margin: 10px;"/> <div style="overflow: hidden; min-width: 180px;"> <h2>This is a Title</h2> <p>This is a paragraph of Text</p> <ul class="list-number-digit digit-brown"> <li>We are located in the heart of historic Branston on the main Lincoln Road.</li> <li>Just 10 minutes South East of Lincoln.</li> <li>We have a large selection of quality Guest Beers, Largers, Bitters, Spirits, Soft drinks and Snacks.</li> <li>We also have a long history of serving the community through a number of local and National Charities.</li> <li>If you have any questions please don't hesitate to call us.</li> </ul> <p>Another Paragraph of text (optional)</p> </div> </div>
<li> and content with imageshow on the right, text area has mimimum width to prevent text wrapping (responsive)
NB: in this example i set imageshow to 419px width X 336px height, Theme Slider
HTML
<div style="overflow: hidden;"> <div style="float: right; margin: 10px;">{imageshow sl=1 sc=1 /}</div> <div style="overflow: hidden; min-width: 180px;"> <h2>This is a Title</h2> <p>This is a paragraph of Text</p> <ul class="list-number-digit digit-brown"> <li>We are located in the heart of historic Branston on the main Lincoln Road.</li> <li>Just 10 minutes South East of Lincoln.</li> <li>We have a large selection of quality Guest Beers, Largers, Bitters, Spirits, Soft drinks and Snacks.</li> <li>We also have a long history of serving the community through a number of local and National Charities.</li> <li>If you have any questions please don't hesitate to call us.</li> </ul> <p>Another Paragraph of text (optional)</p> </div> </div>
Minimum width for the item to prevent title wrapping and splitting lines (responsive)
http://www.inchrye.co.uk/rooms
HTML
<p>Our Rooms at Inchrye Bed and Breakfast are all well maintained but retain a homely feel so you can enjoy your stay in Inverness like it was your own back garden. We have a wide variety of room sizes to suite all family sizes.</p> <p><img alt="Suite Room with Double Bed and own Sitting Room" class="frame-2" src="/images/rooms/suite-room.jpg" style="float: left; margin-left: 15px; margin-right: 15px;" title="Suite Room with Double Bed and own Sitting Room" /></p> <p style="float: left; min-width: 180px;"><strong>Suite Room with Double Bed and own Sitting Room</strong></p> <div style="clear: both;"> </div>
HTML - Easy Version
<p><img style="float: left;" src="/images/pages/home/white-scomadi.jpg" alt="white-scomadi" width="327" height="260" /></p> <div style="float: left;"> <p>Turismo Leggera</p> <p> The Turismo Leggera range represents the<br />culmination of 10 years of prototype development.<br />Utilising the experience of Scooter Innovation & PM<br />Tuning Racing Products, Scomadi are aimed at<br />providing a new era in scootering for followers of<br />iconic Italian design.<br />With styling cues taken from the Grand Prix model<br />the goal was to create a "Modern Classic".<br />A machine that allows the true enthusiast to retain<br />classic styling without sacrificing reliability or<br />modern day functionality. The Turismo Leggera 250<br />was initially released as a carbon fibre,10 machine<br />limited edition hand built in the UK.<br />Demand for further machines evolved into another<br />30 handmade 300cc machines with the latest mass<br />production series of Scomadis presented today.<br />The Turismo Leggera range will present a dynamic<br />package for the discerning scooterist available<br />firstly as air cooled 50cc and 125cc engine options<br />with a flagship model 300cc due for mid 2014.<br />The Scomadi TL300 will be equipped with the Piaggio<br />“class leader”: QUASAR- 300, 4 valve, liquid cooled,<br />engine. One of the lightest, most compact, and<br />powerful 300cc motors on the market. Powered by<br />22HP at 7,500 rpm. The TL300 ensures top<br />performance in terms of speed and acceleration with<br />reliability. </p> </div>
HTML - Image on alternating side, float left then float right
http://www.sidescansystems.com/brite-side-scan-system
<p> The system consists of 4 Ultrasonic sensors mounted down the left side fo the vehicle and a warning display mounted in the cab. When the left hand indicator is on the unit will sense the presence of a cyclist, pedestrian or vehicle and give its posistion and range up to 1.5 mtrs. At the same time, a spoken voice warning is played saying "This vehicle is turning left" to warn anyone on the nearside. </p> <p> </p> <p style="text-align: right;"><img alt="Side Scan Kit" class="frame-2" src="/images/side-scan-kit.jpg" style="float: right;" title="Side Scan Kit" /></p> <p style="margin-left: 80px;"><strong>Features</strong></p> <ul class="tick" style="margin-left: 80px;"> <li>4 x Ultrasonic Sensor with 1.5 mtr range</li> <li>In cab warning unit which displays range and position</li> <li>98db Voice Sounder - "This vehicle is turning left"</li> <li>IP68 Waterproof rated</li> <li>12v-24v operation</li> <li>Can be fitted to almost any vehicle</li> <li>Low speed sensing - shuts off at higher speeds</li> </ul> <div style="clear: both;"> </div> <p> </p> <p><img alt="Choice of Sensors" class="frame-2" src="/images/choice-of-sensors.jpg" style="float: left; margin-left: 15px; margin-right: 15px;" title="Choice of Sensors" /></p> <p> <strong>Choice of sensors - Underslung or Flush Mount</strong><br /> (Depending on application) </p> <div style="clear: both;"> </div>
These are some notes that i used when creating these code samples.
You can use any image for a list bullet as shown below but they must be small enought to fit otherwise the text will become out of alignment with the icon. If you want to use larger images you need to use a different method.
HTML
<ul style="margin-left: 40px; list-style-image: url('/images/kb/2014/498/lists-with-large-custom-icons-that-are-vertically-aligned/tick.png');"> <li>Single room with bed and breakfast £30 per person</li> <li>Double Room with bed and breakfast £35 per person</li> <li>(All Prices shown above are per night)</li> <li>(All rooms are en Suite)</li> </ul>
This method sets a separate icon for each <li> item although you can set a global icon in the <ul>. When you do this the text in the <li> is moved out of horizontal alignment with the icon so it looks messey. To fix this I have surrounded the 'text'/'the whole on the <li> contents' and then I have used a position: relative and top: -10px statement to move the text back into the center of the icons. You now have a nice looking list with large custom icons. The position: relative in the <ul> is important for this to work. You can also put all of the styling into a CSS file if you want.
HTML
<ul style="margin-left: 40px; position: relative;"> <li style="list-style-image: url('/images/kb/2014/498/small-icons/wi_fi_32.png');"><span style="position: relative; top: -10px;">Wi-Fi</span></li> <li style="list-style-image: url('/images/kb/2014/498/small-icons/coffee_maker_32.png');"><span style="position: relative; top: -10px;">Tea and Coffee</span></li> <li style="list-style-image: url('/images/kb/2014/498/small-icons/television_32.png');"><span style="position: relative; top: -10px;">TV</span></li> <li style="list-style-image: url('/images/kb/2014/498/small-icons/towel_32.png');"><span style="position: relative; top: -10px;">Fresh Towels</span></li> <li style="list-style-image: url('/images/kb/2014/498/small-icons/bulls-eye-eggs-with-toast-and-bacon_32.png');"><span style="position: relative; top: -10px;">Our stay includes a traditional English breakfast.</span></li> <li style="list-style-image: url('/images/kb/2014/498/small-icons/corn_flakes_32.png');"><span style="position: relative; top: -10px;">We also have a variation of cereals and fruits available.</span></li> </ul>
grid layout works by splitting the width up by % but on 'mobile' devices, grids fallback to 1 vertical column. Thi sis not ideal in all situations but is an option.
HTML
<div class="grid-layout"> <div>Text in column 1</div> <div>Text in column 2</div> </div>
This is method is really useful for making horizontal menus. You can make all of the items appear on the same line if you make the <ul> wider. I have not tried playing with min-width and max-width but they should work.
HTML
<ul> <li>Electrician in Kent</li> <li>Electrician in Canterbury</li> <li>Electrician in Dover</li> <li>Electrician in Ashford</li> </ul>
CSS
ul { list-style: none; margin: 0 auto; width: 400px; padding: 0; } li { float: left; }
HTML
<ul style="list-style: none;"> <li style="display: inline;">Solar Thermal Panels in Lincolnshire</li> <li style="display: inline;">Ground Heat Source Pumps in Lincolnshire</li> <li style="display: inline;">Wind Turbine Installations in Lincolnshire</li> <li style="display: inline;">Renewable Energy Services in Lincolnshire</li> <li style="display: inline;">Solar Photovoltaic Panels in Lincolnshire</li> <li style="display: inline;">All Ways Green Ltd</li> </ul>
or
CSS
.centered-list li { float: left; list-style: none outside none; padding: 5px; }
HTML
<ul class="centered-list"> <li>Electrician in Kent</li> <li>Electrician in Canterbury</li> <li>Electrician in Dover</li> <li>Electrician in Ashford</li> </ul> <div style="clear: both;"> </div>
you can also use the line below instead of inline CSS
<li style="float: left; list-style: none outside none; padding: 5px;"></li>
This is a basic horizontal list using <div>
HTML
<div style="text-align: center; valign: top; background-color: white;"> <div style="width: 150px; display: inline-block;"> <a title="City and Guilds NPTC" href="http://www.nptc.org.uk/" target="_blank"> <img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" alt="City and Guilds NPTC" /> </a> </div> <div style="width: 150px; display: inline-block;"> <a title="International Society of Arboriculture" href="http://www.isa-arbor.com/" target="_blank"> <img src="/images/modules/498/medium-icons/international-society-of-arboriculture.jpg" alt="International Society of Arboriculture" /> </a> </div> <div style="width: 150px; display: inline-block;"> <a title="Constuction Line" href="http://www.constructionline.co.uk/" target="_blank"> <img src="/images/modules/498/medium-icons/constuction-line.png" alt="Constuction Line" /> </a> </div> <div style="width: 150px; display: inline-block;"> <a title="Acclaim Accreditation" href="http://www.constructionline.co.uk/static/acclaim/" target="_blank"> <img src="/images/modules/498/medium-icons/acclaim-accreditation.png" alt="Acclaim Accreditation" /> </a> </div> </div>
CSS
<style type="text/css"> .qw-list { overflow: hidden; } .qw-list ul { list-style: none; position: relative; float: left; display: block; left: 50%; } .qw-list ul li { position: relative; float: left; display: block; right: 50%; } </style>
HTML
<div class="qw-list"> <ul> <li>Electrician in Kent</li> <li>Electrician in Canterbury</li> <li>Electrician in Dover</li> <li>Electrician in Ashford</li> </ul> </div>
CSS
<style type="text/css"> ul.qw-divmenu { width: 75%; margin: 0 auto; padding: 0; list-style: none; } ul.qw-divmenu li { display: inline-block; } </style>
HTML
<ul class="qw-divmenu"> <li>Electrician in Kent</li> <li>Electrician in Canterbury</li> <li>Electrician in Dover</li> <li>Electrician in Ashford</li> </ul>
I came across this method at WebFusion where they took a clever method for making list with images by using ordered and unoredered lists and replacing the bullet point wiht an image.
So this method will requires some html code and some CSS code. The CSS code could be inline if you needed.
CSS
ul.icon_list { list-style: none; } .icon_list li { margin-top: 0px; margin-right: 0px; margin-bottom: 18px; margin-left: 0px; } .medium .customised { /*background-position: 0px -4695px;*/ } .medium .flexible { /*background-position: 0px -4895px;*/ } .icon_list.medium li { padding-left: 60px; background-color: transparent; background-image: url("images/modules/498/small-icons/television_32.png"); background-repeat: no-repeat; background-attachment: scroll; /*background-position: 0px 5px;*/ background-clip: border-box; background-origin: padding-box; background-size: auto auto; }
This CSS code utilises image sprites but can easily be adapted to use normal images
HTML
<ul class="icon_list medium green"> <li class="customised"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </li> <li class="flexible"> Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. </li> </ul>
Address: 198 Example street, Suite 7s new York, NY 10013
Phone: 112 345 6798
Email: example@email.com
CSS
.fu-list li { clear: both; margin: 15px 0 0; padding-bottom: 0; list-style-type: none; list-style-position: outside; } .fu-list .fu-icon-wrapper { width: 20px; height: auto; line-height: 24px; margin: 1px 10px 0 0; z-index: 9; text-align: center; /* evens all the icons up */ float: left; } .fu-list .fu-icon-wrapper i[class*="fa"] { font-size: 18px; display: block !important; color: #000; } .fu-list .fu-content { overflow: hidden; /* this prevents the text flowing under the icon */ } .fu-list .fu-content p { padding: 0; margin: 0; }
HTML
<ul class="fu-list"> <li> <div class="fu-icon-wrapper"><i class="fa fa-map-marker"></i></div> <div class="fu-content"><p>Address: 198 Example street, Suite 7s new York, NY 10013</p></div> </li> <li> <div class="fu-icon-wrapper"><i class="fa fa-mobile"></i></div> <div class="fu-content"><p>Phone: 112 345 6798</p></div> </li> <li> <div class="fu-icon-wrapper"><i class="fa fa-envelope"></i></div> <div class="fu-content"><p>Email: <a href="mailto:example@email.com">example@email.com</a></p></div> </li> </ul> <div style="clear: both;"> </div>
Notes
This is a really nice solution to having icons in a list.
CSS
.product-list { font-family: wf_segoe-ui_normal, 'Segoe UI', Segoe, 'Segoe WP', Tahoma, Verdana, Arial, sans-serif; font-size: 100%; } .product-list ul { list-style: none; list-style-type: none; margin: 0; padding: 0; } .product-list li { margin: 0; padding: 0; line-height: 1.25; display: block; margin: 0 0 0.75em; font-size: 1em; } .product-list li.heading { font-size: 1em; font-weight: normal; margin-bottom: 0.65em; } .product-list .product-link { } .product-list li a { color: #1A1A1A; font-size: 0.9em; font-size: 1em; cursor: pointer; text-decoration: none; height: 10px; vertical-align: top; } .product-list li img { display: inline-block; height: 26px; width: 26px; margin-bottom: -0.45em; margin-right: 10px; max-width: 100%; border: none; } .product-list li img.product-left { float: left; } @screen and (min-width: 540px;) { .product-list ul:first-child { margin-top: 0em; } }
HTML
<div class="product-list"> <ul> <li class="heading">Product List Title</li> <li><a target="_self" class="product-link" href="http://quantumwarp.com/">Example Product 1<img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" class="product-image product-left" alt="logo"></a></li> <li><a target="_self" class="product-link" href="http://quantumwarp.com/">Example Product 2<img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" class="product-image product-left" alt="logo"></a></li> <li><a target="_self" class="product-link" href="http://quantumwarp.com/">Example Product 3<img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" class="product-image product-left" alt="logo"></a></li> <li><a target="_self" class="product-link" href="http://quantumwarp.com/">Example Product 4<img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" class="product-image product-left" alt="logo"></a></li> <li><a target="_self" class="product-link" href="http://quantumwarp.com/">Example Product 5<img src="/images/modules/498/medium-icons/city-and-guilds-nptc.jpg" class="product-image product-left" alt="logo"></a></li> </ul> </div>
Just like PHP (ie php.ini), phpMyAdmin also has its own execution time limit. Why? I dont know.
You are most likely to see an error like the one below:
Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\phpmyadmin\libraries\dbi\mysql.dbi.lib.php on line 140
To increase the phpMyAmin execution time, you need to edit the file
Add this line to xampp\phpmyadmin\config.inc.php
$cfg['ExecTimeLimit']=6000;
You might also want to change the settings below in the normal php.ini file if you still are getting timeout errors.
And Change xampp\php\php.ini to
post_max_size =750M
upload_max_filesize =750M
max_execution_time =5000
max_input_time =5000
memory_limit =1000M
And change xampp\mysql\bin\my.ini
max_allowed_packet =200M
Example 1
#contact #center_column p {margin:0; padding:0 0 10px 0;} #contact fieldset p {padding-left: 60px;} /* correct drop down placement */
Even thought the padding-left is after, the first line take presidence because it is further down the element chain. so line 1 will apply.
Example 2
#contact #center_column p {margin:0; padding:0 0 10px 0;} #contact #center_column fieldset p {padding-left: 60px;} /* correct drop down placement */
In this example line 2 will be applied because the are at the same element level, but then line 2 is after line 1 so is applied as you normally expect css to work.
Full Syntax
{nicepaypal:button type|amount|item name|item number|shipping|shipping2|tax|item quantity|weight|option1|option2}
Real World Examples
{nicepaypal:cart|79.99|Custom Teeth Whitening Trays|||||field;Enter Quantity;1;3||} <p>{nicepaypal:cart|79.99|Custom Teeth Whitening Trays|||||field;<strong>Enter Quantity</strong>;1;}</p>
To prevent version of Joomla being identified. A way to check if you're running a Joomla site and what version by what files and directories are present. Also will prevent Blind Elephant working. One of the easiest ways for an attacker to decide if your site is a potential Joomla! target is to perform a rudimentary visual fingerprinting.
Template Issues, Deny these links via htaccess
* You should also remove (if not needed) the default joomla images. Presence of Certain default files and folders can ID the Joomla Version. Delete the following:
Directories:
Files:
Other Fingerprinting
Error Reporting to None
Prevents any minor glitch to reveal sensitive server configuration information to a potential hacker). If this doesn't work, disabling PHP's error output to the browser in the php.ini. Leaving Error Reporting set to anything else except NONE will slow down your website and give hackers a security hole that they can use to peer into your server settings and PHP environment. Turn it off (NONE) unless you are debugging at the moment. Only use Error Reporting while testing or debugging. Otherwise keep it turned off.
robots.txt is a security nightmare.
- create deny lists for certain folders. better than identifying them in robots.txt
- Think twice about what you put in your robots.txt, since this is a common source for attackers to find interesting URLs
- ideally - make everything dissallowed and then add exceptions. this will not show what folders are there
if suhosin patch is installed this can cause unxplained issues where stuff will not run. it cannot be disabled by users but can be put in simulation mode (same thing)
find extension="suhosin.so" and add the following line below to give
extension="suhosin.so"
suhosin.simulation="On"
This useful article shows you what parts of a URL you can build with .htaccess server environmental variables.
Below I have named the various parts of a URL and given the corresponding global PHP variable. This is not an exahstive list as you can get usrrname passwords from a URL
https://user123:password1@video.quantumwarp.com:8080/subfolder/subfolder2/index.php?turnip=51&alien=54#myniceheading 1 2 3 4 5 6 7 8 9 10 ## PHP Variables ## $_SERVER['SERVER_PROTOCOL'] 1-2 (:// is not included) $_SERVER['HTTPS']; (This is a Boolean) $_SERVER['PHP_AUTH_USER'] 2-3 $_SERVER['PHP_AUTH_PW'] 3-4 (: and @ are not included) $_SERVER['SCRIPT_NAME']; 4-8 $_SERVER['PHP_SELF']; 4-8 $_SERVER['HTTP_HOST']; 4-6 $_SERVER['SERVER_NAME']; 4-6 $_SERVER['SERVER_PORT']; 6-7 (: is not included) $_SERVER['REQUEST_URI']; 7-10 (fragment might not be included) $_SERVER['QUERY_STRING']; 8-9 (? is not included) ## Part Names ## Protocol 1-2 Username 2-3 Password 3-4 Sub Domain 4-5 Domain 5-6 Port 6-7 Path 7-8 Query 8-9 Fragment 9-10 (some might refer to this as an Anchor)
To change the database prefix to prevent SQL Injection Attack (if not done during install)
Backup your database and site first.
Newer version of PHPMyAdmin have a table prefix changer inbuilt and is now the prefered method.
Taken from here
This table quickly converts times into seconds for the use in htaccess rules.
#-------------------------------------------
# TIME CHEAT SHEET 2
#-------------------------------------------
# 300 5 MIN
# 600 10 MIN
# 900 15 MIN
# 1800 30 MIN
# 2700 45 MIN
#
# 3600 1 HR
# 7200 2 HR
# 10800 3 HR
# 14400 4 HR
# 18000 5 HR
# 36000 10 HR
# 39600 11 HR
# 43200 12 HR
# 46800 13 HR
# 50400 14 HR
# 54000 15 HR
# 86400 24 HR
#
# 86400 1 DAY
# 172800 2 DAY
# 259200 3 DAY
# 345600 4 DAY
# 432000 5 DAY
# 518400 6 DAY
# 604800 7 DAY
#
# 604800 1 WEEK
# 1209600 2 WEEK
# 1814400 3 WEEK
# 2419200 4 WEEK
#
# 2419200 1 MONTH
# 4838400 2 MONTH
# 7257600 3 MONTH
# 9676800 4 MONTH
# 12096000 5 MONTH
# 14515200 6 MONTH
# 16934400 7 MONTH
# 19353600 8 MONTH
# 21772800 9 MONTH
# 24192000 10 MONTH
# 26611200 11 MONTH
# 29030400 12 MONTH
google prefers expires and set to 1 month
look at apache redirect and double slash section and make run quicker ie expressions ?*+
(.*) is really hungry
see - http://www.joomlaperformance.com/articles/performance/so_you_want_to_speed_up_joomla_3_14.html
- joomla and jot cache do not store headers
Notes
when stuff doesnt work try this
These are the headers that are set for the aggregated file:
Cache
HTML Output
Other
dont gzip jpg and png because it makes them bigger ? (check this)
Which Parameters are Important?
PHP Compression
compressing a websites output makes the delivery of the content to the browser quicker.
Basically most images, css, javascript, and other files can be optimized for faster download by telling your site visitors to cache them for a certain period of time. The default behaviour is to check the last-modified and/or the Etag headers of the file EVERY time it is requested.
So a user goes to /home/index.html, and the browser caches all the images and files. Then the user leaves the site and comes back later, and the browser has to send If-Modified-Since conditional GET requests for every cached item, basically to see if the file has been changed and if they should update their cache.
Dynamic content cannot be cached via htaccess, ie joomla unless you add the headers to the output via php
When files are then cached by your site visitors they do not send the If-Modified-Since until the set cache time has completed.
Once an item is cached it will remain cached until it expires or gets revalidated
The Expires and cache-control headers can’t be circumvented; unless the cache (either browser or proxy) runs out of room and has to delete the representations
the cached copy will be used until then which means less http requests
Expires/max-age are superior as they mean there's no need for a request. However, ETag/Last-Modified is still better than nothing.
less http requests
ETag and Last-Modified headers are on by default
BE WARNED. Do not set to long a expire time
YSlow has a minimum far future date - to be added here soon i think it is 1 week google is 1 month and wants expires
Cache-Control : max-age = [delta-seconds]
Modifies the expiration mechanism, overriding the Expires header. Max-age implies Cache-Control : public.
Cache-Control : public
Indicates that the object may be stored in a cache. This is the default.
Cache-Control : private
Cache-Control : private = [field-name]
Indicates that the object (or specified field) must not be stored in a shared cache and is intended for a single user. It may be stored in a private cache (ie browser cache).
Cache-Control : no-cache
Cache-Control : no-cache = [field-name]
Indicates that the object (or specified field) may be cached, but may not be served to a client unless revalidated with the origin server.
Cache-Control : no-store
Indicates that the item must not be stored in nonvolatile storage, and should be removed as soon as possible from volatile storage.
Cache-Control : no-transform
Proxies may convert data from one storage system to another. This directive indicates that (most of) the response must not be transformed. (The RFC allows for transformation of some fields, even with this header present.)
Cache-Control : must-revalidate
Cache-Control : proxy-revalidate
Forces the proxy to revalidate the page even if the client will accept a stale response. Read the RFC before using these headers, there are restrictions on their use.
Caveats
Notes
"max-age" value indicates the time difference (in seconds) after which the content will be expired and reloaded from the server
"public" keyword presence indicates that any system along the route may cache the response
"must-revalidate" indicates caching systems to obey other header information you may provide at a later time about the cache. This should help preventing stale caching (that is, caching that delivers content that is outdated).
by eliminating the Last-Modified and ETags headers, you are eliminating validation requests, leading to a decreased response time. This should work fine in most cases when dealing with static, rarely updated content.
Example 1
http://tutorialpedia.org/tutorials/Apache+enable+file+caching+with+htaccess.html
Example 2
http://linuxdevcenter.com/pub/a/linux/2002/02/28/cachefriendly.html?page=2
The reason I remove and disable the ETag is because supposedly some browsers will ignore your Expires header when it’s present:
The reason I remove the Last-Modified header is for the same reason:
The reason I set the Cache-Control header to ‘public’ is so the browser will cache media over HTTPS (see tip #3):
The reason I set the Cache-Control header to ‘no-transform’ is to prevent proxies from modifying my content.
Vary: Accept-Encoding response header. This instructs the proxies to cache two versions of the resource: one compressed, and one uncompressed.
Example
Header unset Server
Header unset Last-Modified
Header unset Date
Header unset Accept-Ranges
Header unset Content-Length
Header unset Keep-Alive
Header unset Connection
Header unset Content-Type
Header unset Cache-Control
Header unset Expires
Header unset Pragma:
When I uncomment my changes, then I get the full header:
HTTP/1.x 200 OK
Date: Wed, 17 Sep 2008 19:37:42 GMT
Server: Apache
Last-Modified: Wed, 17 Sep 2008 15:30:07 GMT
Accept-Ranges: bytes
Content-Length: 58
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: text/html
The Last-Modified header allows validation based on the component's timestamp
Removing this reduces HTTP requests and disables this type of cache header
The most common validator is the time that the document last changed, as communicated in
Last-Modified header. When a cache has an representation stored that includes a Last-Modified header,
it can use it to ask the server if the representation has changed since the last time it was seen, with an If-Modified-Since request.
if this header is present the browser checks back to the server that is has not been changed and then it uses the cached version