Rss Feed

Cache d’une requête ColdFusion

Soulager le serveur en mettant en cache les requêtes sql.Il suffit d’ajouter au CFQUERY l’attribut CachedWithin.Peut-on faire plus simple ?Exemple :

<cfquery datasource="maBase" name="reqDepartement">CachedWithin="#CreateTimeSpan(0,1,0,0)#"&gt;SELECT codePostal, villeFROM tableFranceORDER BY codePostal</cfquery>

Si vous souhaitez faire par exemple un cache chaque jour à 6h du matin, vous pouvez utiliser cachedafterExemple :

<cfquery datasource="maBase" name="reqDepartement">cachedafter="#CreateDateTime(Year(Now()),Month(Now()),Day(Now()),6,0,0)#"&gt;SELECT codePostal, villeFROM tableFranceORDER BY codePostal</cfquery>
Partager :
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • LinkedIn
  • Technorati
  • Twitter

Articles sur le même sujet :

  1. Une requête sous ColdFusion

Laisser un commentaire

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word