Added timestamp to ressources to avoid caching
This commit is contained in:
		
							parent
							
								
									618453713d
								
							
						
					
					
						commit
						87e3be4444
					
				
					 2 changed files with 9 additions and 3 deletions
				
			
		
							
								
								
									
										5
									
								
								game.py
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								game.py
									
										
									
									
									
								
							|  | @ -66,6 +66,9 @@ def hello(): | |||
|     separator_char = config.get('main', 'separator_char') | ||||
|     ablines = [] | ||||
| 
 | ||||
|     now = datetime.now(tz=tz) | ||||
|     epoch = now.timestamp() | ||||
| 
 | ||||
|     lines = getContent() | ||||
|     for line in lines: | ||||
|         ab = line.split(separator_char) | ||||
|  | @ -76,7 +79,7 @@ def hello(): | |||
|     with open("ab.txt", "r") as f: | ||||
|         num_lines = sum(1 for _ in f) | ||||
| 
 | ||||
|     return render_template('index.html', title=title, separator=separator, content=ablines, num_lines=num_lines) | ||||
|     return render_template('index.html', title=title, separator=separator, content=ablines, num_lines=num_lines, epoch=epoch) | ||||
| 
 | ||||
| def getContent(): | ||||
|     lines = [a.strip() for a in open("ab.txt", "r").readlines()] | ||||
|  |  | |||
|  | @ -2,7 +2,7 @@ | |||
| <html lang="de"> | ||||
|     <head> | ||||
|         <title>{{ title }}</title> | ||||
|         <link rel="stylesheet" type="text/css" href="/css/ab.css"> | ||||
|         <link rel="stylesheet" type="text/css" href="/css/ab.css?t={{ epoch }}"> | ||||
|         <link rel="apple-touch-icon" sizes="180x180" href="{{ url_for('static', filename='apple-touch-icon.png') }}"> | ||||
|         <link rel="icon" type="image/png" sizes="32x32" href="{{ url_for('static', filename='favicon-32x32.png') }}"> | ||||
|         <link rel="icon" type="image/png" sizes="16x16" href="{{ url_for('static', filename='favicon-16x16.png') }}"> | ||||
|  | @ -30,7 +30,10 @@ | |||
|             <div id="footer"> | ||||
|                 <div id="questions">Es gibt derzeit {{ num_lines }} Fragen.</div> | ||||
|                 <div class="separator"> </div> | ||||
|                 <form action="/"><button id="next" type="submit">Neue Fragen</button></form> | ||||
|                 <form action="/" method="get"> | ||||
|                     <input type="hidden" name="t" value="{{ epoch }}"> | ||||
|                     <button id="next" type="submit">Neue Fragen</button> | ||||
|                 </form> | ||||
|             </div> | ||||
|         </div> | ||||
|     </body> | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue