Static resources not updated?

15 views
Skip to first unread message

Tonny

unread,
Sep 8, 2010, 9:26:45 AM9/8/10
to Google App Engine
I did and uploading 10 minuttes, but my static resources has not
changed when i load them through the webserver?

Does anybody have similar problems currently?

Regards
Tonny

Ikai L (Google)

unread,
Sep 8, 2010, 1:50:30 PM9/8/10
to google-a...@googlegroups.com
Can you try using curl or wget? It could be that they are still cached in your browser.


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.




--
Ikai Lan 
Developer Programs Engineer, Google App Engine

P. Petrov

unread,
Sep 8, 2010, 4:26:56 PM9/8/10
to Google App Engine
This generally happens when you set a custom expiration time for
static files. This causes Google's frontend servers to cache the files
for up to the specified time, and they don't update it even if you
push a new version in the mean time. This is true both for
*.appspot.com and for custom domains. You can take a look at the HTTP
headers returned by your Google Frontend server, e.g. using Firebug,
to see when the next refresh will happen.

If you don't set custom expiration for static files, the frontend
servers seem to fetch the resources every time (or at least very
frequently). On the other hand, the browsers' caching behaviour is
then undefined. In any case, you should use cache-busters.

Tonny

unread,
Sep 9, 2010, 3:48:37 AM9/9/10
to Google App Engine
I used curl - just to make sure, but still got the old file, evt. the
file updated though (by "magic") after 5-10 minuttes.

On Sep 8, 7:50 pm, "Ikai L (Google)" <ika...@google.com> wrote:
> Can you try using curl or wget? It could be that they are still cached in
> your browser.
>
>
>
>
>
> On Wed, Sep 8, 2010 at 6:26 AM, Tonny <12br...@gmail.com> wrote:
> > I did and uploading 10 minuttes, but my static resources has not
> > changed when i load them through the webserver?
>
> > Does anybody have similar problems currently?
>
> > Regards
> > Tonny
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine" group.
> > To post to this group, send email to google-a...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengi...@googlegroups.com<google-appengine%2Bunsubscrib e...@googlegroups.com>
> > .

Tonny

unread,
Sep 9, 2010, 3:49:46 AM9/9/10
to Google App Engine
This could what was happening, since the new files was available after
5-10 minuttes (as mentioned i used curl to look). I have no customized
expire times though.

Ikai L (Google)

unread,
Sep 9, 2010, 2:29:46 PM9/9/10
to google-a...@googlegroups.com
Are you using a YAML file configuration for static assets? There's a place to set expires times. At any rate, next time this happens, take note of the headers returned and post them. 

As a best practice, in your URLs to your static assets, you should have cache busters since this'll also cover the case of folks with weird local browser cache settings.

--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Tonny

unread,
Sep 13, 2010, 3:53:04 AM9/13/10
to Google App Engine


On Sep 9, 8:29 pm, "Ikai L (Google)" <ika...@google.com> wrote:
> Are you using a YAML file configuration for static assets? There's a place
> to set expires times. At any rate, next time this happens, take note of the
> headers returned and post them.
I have this for the files in affected:
- url: /s/x.y
static_dir: static/my.library

where my.library contains javascript files.

I'll post the header the next time i see the issue.

>
> As a best practice, in your URLs to your static assets, you should have
> cache busters since this'll also cover the case of folks with weird local
> browser cache settings.
Yeah, I know. So far I have gotten away with including the files
directly.
Since I'm writting "raw" Mootools based javascript with nothing but a
home brewed build system,
cache busting i not a trivial task - if someone reading this post can
bust this perception i would like
to hear :-).
> > google-appengi...@googlegroups.com<google-appengine%2Bunsubscrib e...@googlegroups.com>
> > .

Ikai Lan (Google)

unread,
Sep 13, 2010, 2:56:51 PM9/13/10
to google-a...@googlegroups.com
It's not trivial, but it's not hard, either. Here's one approach (of many):

1. Create a deploy script to wrap the appcfg.py update
2. Pre deploy, your script create a Python file that declares a variable with the current time
3. In your javascript and CSS include statements in your HTML, modify the URL like this:

/js/some.js?v={{ GLOBAL_TIMESTAMP }}

 (ContextProcessors are key here if you are using Django templates)

Just changing the URL with a meaningless parameter on a static asset should be enough to ensure that browsers and proxies force download a new version of your asset file.

To unsubscribe from this group, send email to google-appengi...@googlegroups.com.

Tonny

unread,
Sep 20, 2010, 9:06:25 AM9/20/10
to Google App Engine
My minds was stuck on a: myscript-x.y.z.js naming scheme, the solution
you suggest is a off course much simpler to administrate.

Thanks again.

Cheers
Tonny

On Sep 13, 8:56 pm, "Ikai Lan (Google)" <ikai.l+gro...@google.com>
wrote:
> > > > google-appengi...@googlegroups.com<google-appengine%2Bunsubscrib e...@googlegroups.com><google-appengine%2Bunsubscrib
Reply all
Reply to author
Forward
0 new messages