Jump to content


Member Since 19 May 2007
Offline Last Active Jan 28 2017 12:39 PM

Posts I've Made

In Topic: Redirect after deletion of comment and timestamp update = no cache revalidation

21 February 2012 - 01:38 PM

Ok. I'm pretty sure i have this problem solved now.

Turned out the location header alone was redirecting trough a 302 response, rather than a 303.
After i added the 303 thing, everything now appears to behave as expected.

If the server just responds with a 302, it appears that the browser just re-loads the page from the cache, without performing the re-validation that the server originally requested for the given page.
When using a 303 however, it would seem that it properly re-checks the cache headers of the page.

In Topic: Is it good practice to make PHP and Javascript based CSS files?

27 January 2012 - 09:22 PM

Its a very bad idea to just place your CSS directly in a style element on your page. It does make each of your pages load faster, but when you got multiple pages using the same CSS, it quickly starts to load slower than it would with External CSS files. That's because these External files are cached by the browser.

If you just got a single page, then its fine to just throw in your CSS in a style element on the page, and save the time involved in making another HTTP Request.

You can however minimize your CSS files dynamically on the server-side, removing all white space and linebreaks. This can sometimes provide a huge performance increase, and still maintain readability in the raw files.

Obviously it takes a little server CPU to process the files, so you shouldn't do this if your server doesn't have the resources. But for most sites, this won't be an issue, not even on shared hosts.

You basically just need to deliver the correct Content-type, in this case text/css for CSS files. But you would also want to control the caching of the files manually, either based on the last-edited tag of the files themselves, or from a timestamp saved in your database. You could even save a minimized version of your CSS and deliver this directly, which would save you CPU on the minimizing process.

Without the caching, there's little point using PHP to minimize the files, since the browser would just re-download the files on each request, rather than using the version from the cache.

The same can be done to markup such as HTML, but this would likely require that you output the entire page at once, similar to whats done in python. For example, if you got the entire page in a variable, then its easy to remove whitespace and linebreaks where you don't want them, and increase the speed for your site even more. Can be done in PHP as well, but you would most likely want a better approach, than just escaping in and out of your HTML/Markup.

In Topic: website updation

27 January 2012 - 08:50 PM

Its better to just install a free CMS solution, then mess with these poor WYSIWYG tools, but even then you must be careful with the WYSIWYG tools in the CMS system. Not all CMS systems handle WYSIWYG very well, and likely most of them will still provide features in their WYSIWYG modules that shouldn't be there in the first place, simply because a user wouldn't be able to use them currectly.

Beginners often make the mistake to assume that WYSIWYG tools will let them create their own website, without knowing HTML/CSS.

Of cause its possible, but you mostly end up with invalid HTML, often using div in place of p and crap like that. I've even seen cases where someone would use blockquote to force indention of elements, and this is even a default feature provided in the WYSIWYG editor for indention in their CMS, (a very expensive CMS I'd might add).

In Topic: Really strange problem with P-2601HN-F1 router

17 January 2012 - 03:33 PM

Yes only the LAN clients are effected. I disabled all security in the router for now, until i figure out what is going on.

The router has the ability to run a loopback test, which returns with a success message.

I also updated the firmware, and had to restart the router in that process, so regardless if that solved the problem, the restart it self has solved it temporarily. I'll likely get back if it turns out the update didn't fix it.

In Topic: Trying to center auto expanding div

11 November 2011 - 04:12 AM

You just need to apply a min-width to your accountContent, a width would also work, but it depends on what you want to accomplish.

Also remember that margin: 0 auto; will center the div. IE6 will need text-align:center; on the parent.