Kuriyaki Posted June 30, 2009 Share Posted June 30, 2009 I am creating a website which will query a database for information. The thing is, I don't want my pages to look likesite.com?postid=5 I actually want a post to look something of the rathersite.com/category/postdescriptorIn other words, I want to have a cached copy of the page without having the user having to query the database each time. Given a certain expiration, I would like to provide a fresher page later on as well. How is this done? I'm fairly knowledgeable with PHP, JavaScript, MySQL, as I'm building this site from the ground up. This is the only thing I need help with to get running. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 30, 2009 Share Posted June 30, 2009 There are various headers you can send to control the caching policies. It's up to the browser whether or not they follow them, but you can at least give them the guidelines. It sounds like you're also looking for URL rewriting, on Apache servers that's done using mod_rewrite with .htaccess files and there are some ISAPI modules that do rewriting for IIS. Link to comment Share on other sites More sharing options...
Kuriyaki Posted June 30, 2009 Author Share Posted June 30, 2009 Awesome. Thanks for the reply.I managed to stumble onto a great resource http://www.yourhtmlsource.com/sitemanageme...lrewriting.htmlI'll be looking onto the caching solution shortly afterwards. (Or do you know of any handy?)Thanks again. Link to comment Share on other sites More sharing options...
justsomeguy Posted June 30, 2009 Share Posted June 30, 2009 The headers to use would be cache-control, expires, and pragma. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.