last-modified

Nginx does not refresh file after repeated changing. Old Last Modified header is returned

六眼飞鱼酱① 提交于 2019-12-07 07:24:05
问题 I have web-application, and there is interface where I can refresh logo of a shop. When I refresh logo, I gеt new file with new last-modified header: Nginx returns corrected updated file. After that I update logo again. But I get old logo with old last-modified , although logo url file was changed (you can see query timestamp at the end of url): If I perform direct request through browser, then I get updated file: This can be seen in the file size via content-length. My nginx config for

How to change the file's permission and last modified in Java?

假装没事ソ 提交于 2019-12-06 11:07:21
To my knowledge, Java's File class does not support to change the file's permission and last modified date. Is there any proper way to do this in a cross-platform style? I'm looking at the Java 6 documentation , and there is a setLastModified() method, as well as setReadable(...) and setWritable(...) and setExecutable(...) methods (all in the java.io.File class). So yes, there is a way... 来源: https://stackoverflow.com/questions/459622/how-to-change-the-files-permission-and-last-modified-in-java

Indefinitely caching a HTTP response via Nginx fails

六眼飞鱼酱① 提交于 2019-12-06 10:54:52
问题 I'm trying to tell nginx to cache some of my assets (js, css) forever, or at least for a very long time. The idea is that once an asset bundle is compiled and published with an /assets/ URI prefix (e.g. /assets/foo-{fingerprint}.js ) it stays there and doesn't ever need to change. The internets told me I should write the following rule: location ~ ^/assets/.*-([^.]+)\.(js|css)$ { gzip_static on; # there's also a .gz of the asset expires max; add_header Cache-Control public; add_header Last

Search DAM assets and Cq pages using lastModified date | QueryBuilder

白昼怎懂夜的黑 提交于 2019-12-06 07:04:15
问题 I am querying the cq pages and assets based on the last modified date. Here is the the text that has to be put in query builder debugger: fulltext=geometrix 1_group.p.or=true 1_group.1_group.p.and=true 1_group.1_group.path=/content 1_group.1_group.type=cq:Page 1_group.1_group.relativedaterange.property=jcr:content/cq:lastModified 1_group.1_group.relativedaterange.lowerBound=-1M 1_group.2_group.p.and=true 1_group.2_group.path=/content/dam 1_group.2_group.type=dam:Asset 1_group.2_group

http请求缓存头详解

独自空忆成欢 提交于 2019-12-06 06:46:26
缓存的作用: 1.减少延迟(页面打开的速度)。 2.降低服务器负载(先取缓存,无缓存在请求服务器,有效降低服务器的负担)。 3.保证稳定性(有个笑话是手机抢购时为了保证服务器的稳定性,在前端写个随机数限制百分之二十的人发送数据到后台,这也侧面说明了缓存对于稳定性的作用)。 下图是自己画的,有点丑,请原谅!待会讲解! 浏览器与服务器进行通讯包含两部分: 1.请求头header(包含各种缓存信息)。 2.请求体bdoy(数据发送的主要内容) 页面缓存是由header决定的,包含四个参数: 一、Expires: http1.0推出的,指服务器返回的文件有效期,但其实这是有缺陷的,如果把本地的时间改为2118年,那Expires的时间怎么都会过期。 二、Last-Modified: http1.0推出的,指服务器文件的最后修改时间,浏览器会带上If-Modified-Since向服务器发送请求,与服务器文件修改时间Last-Modified做对比,如果时间不同,则获取数据返回200,否则返回304后调用浏览器本地硬盘的缓存。 这种方式也有问题,如果服务端文件频繁修改保存,那么Last-Modified就会频繁更改,每次都从服务端获取,这也就有了http1.1的修改。 从网上拿了个angular.js地址试了一下,第一次返回200,第二次刷新页面返回304。 时间:本地缓存获取>服务器获取

.htaccess not working - only caching images and not JS or CSS [duplicate]

◇◆丶佛笑我妖孽 提交于 2019-12-06 04:26:13
问题 This question already has answers here : Closed 10 years ago . Duplicate: Why isn’t my javascript & css caching ? I'm noticing that I'm only receiving 304 HTTP codes (cached content) for images but not JavaScript or CSS. My .htaccess file is: Options -Indexes Options +FollowSymLinks # Enable ETag FileETag MTime Size # Set expiration header ExpiresActive on ExpiresDefault "access plus 1 week" # Compress some text file types AddOutputFilterByType DEFLATE text/html text/plain text/css text/xml

How can you mine the “Last Modified Date” for an ASP.NET page which is based on a Master Page?

落爺英雄遲暮 提交于 2019-12-06 01:51:14
We would like to embed some code in each ASP.NET page that queries its "Last Modified Date" and displays it at the bottom of the page. In the past, we've relied on the person making any changes to the page to manually update the " This page last modified on (todays date) " text at the bottom of the page. Many times they forget to update this, which is causing some confusion as to when the information was last updated on that particular page. Since the site is not based on a CMS which could store this information in its back-end database, we're trying to do the determination as to when the page

How can I extract Last Modified Date in MS Azure for a blob in my blob storage

天涯浪子 提交于 2019-12-05 18:19:52
I am pretty new to the world of MS Azure. I am trying to get the filenames and the last modified date for a bunch of files (block blobs) kept in my blob storage using Python. Here is the code that I am using: import datetime from azure.storage.blob import BlockBlobService blob_service = BlockBlobService(account_name=account, account_key=acckey,protocol='http', request_session=sess) blob_service.get_blob_to_path(container, pdfname, pdflocal) generator = blob_service.list_blobs(container) filenames = [] for blob in generator: print (blob.name) pdflocal = './' + blob.name properties=blob_service

Why is Java (Android?) setting my file's last modified date to tomorrow?

本秂侑毒 提交于 2019-12-05 14:38:51
I'm creating files in my Android application using: FileOutputStream fos = context.openFileOutput(fileName, Context.MODE_PRIVATE); fos.write(data); fos.flush(); fos.close(); Then later I'm trying to do some cleanup, so I'm comparing the last modified date to some threshold value, but the comparison is showing that the file's last modified date is tomorrow sometime. Keep in mind, when I say tomorrow, that is relative to today (the file modification date)... whichever day this may be that you're reading this. So basically, if I create the file today, and check the file's last modification date,

Nginx does not refresh file after repeated changing. Old Last Modified header is returned

房东的猫 提交于 2019-12-05 12:43:38
I have web-application, and there is interface where I can refresh logo of a shop. When I refresh logo, I gеt new file with new last-modified header: Nginx returns corrected updated file. After that I update logo again. But I get old logo with old last-modified , although logo url file was changed (you can see query timestamp at the end of url): If I perform direct request through browser, then I get updated file: This can be seen in the file size via content-length. My nginx config for images is: location ~* ^.+\.(jpg|jpeg|svg|gif|png)$ { expires 10d; try_files $uri @app; } I don't understand