Cache Rest
Sup guys,
I'm developing a rest api for an app with cakephp to be consumed by smarthphones, and i need to make a cache of data.
I already make cache of queries with apc, but i still have traffic with this...
i'll probably use http cache expire, but when expire, the data can be the same and will generated unnecessary traffic because the size of packet...
Why i'm doing this??
3G in brazil sucks
My objective is reduce the traffic size
Example how will work:
- SMARTHPHONE: Make a requisition
- SERVER: receive the requisition,
- SERVER: generate a md5 of content
- SERVER: save in a DB, the url and url parameters associated to the md5 of content that will be returned
- SERVER: return the content with generated md5
- SMARTHPHONE: storage the content, and create a hashmap with url with params, md5 of content, expire date, and the content
So when expires :
- SMARTHPHONE: make new requisition, sending the md5
- SERVER: receive the requisition and verify if the generated content is different verifying both md5
- SERVER: if different, return the new content and new md5
- SERVER: if equal, return the new expire date
- SMARTHPHONE: if diffrent, storage the new data
- SMARTHPHONE: if equal, update the new expire date
---
So, i don't know if already exist a plugin that handle this...
And what I wrote above make any sense
Thanks, and sorry for my english
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home