Added requests caching on backend to hit the meals db less
This commit is contained in:
		
							parent
							
								
									4206cb4809
								
							
						
					
					
						commit
						bb989c5422
					
				
					 5 changed files with 4 additions and 1 deletions
				
			
		|  | @ -3,7 +3,7 @@ | ||||||
| ## Getting Started | ## Getting Started | ||||||
| 
 | 
 | ||||||
| ```bash | ```bash | ||||||
| pip3 install requests gunicorn pycnic | pip3 install requests requests-cache gunicorn pycnic | ||||||
| gunicorn api:app | gunicorn api:app | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
										
											Binary file not shown.
										
									
								
							|  | @ -1,8 +1,11 @@ | ||||||
| from pycnic.core import WSGI, Handler | from pycnic.core import WSGI, Handler | ||||||
| from key_replacer import KeyReplacer | from key_replacer import KeyReplacer | ||||||
| import requests | import requests | ||||||
|  | import requests_cache | ||||||
| import json | import json | ||||||
| 
 | 
 | ||||||
|  | requests_cache.install_cache() | ||||||
|  | 
 | ||||||
| class Base(Handler): | class Base(Handler): | ||||||
|     hostname = "https://www.themealdb.com/api/json/v1/1/" |     hostname = "https://www.themealdb.com/api/json/v1/1/" | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
							
								
								
									
										
											BIN
										
									
								
								python-api/cache.sqlite
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								python-api/cache.sqlite
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								python-api/meals_cache.sqlite
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								python-api/meals_cache.sqlite
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Ava Gaiety Wroten
						Ava Gaiety Wroten