Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Force.com Sites & Site.com
- :
- Re: Strange Cache Problem
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Strange Cache Problem
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-28-2012 08:51 PM
I have a sites page, and it seems to work fine. It has a custom controller that retrieves some data from a custom object and the Contact object, displays the info to the user, and lets them submit an updated version to the data into another custom object.
But after a certain amount of time (24-48 hours), when I go to the page I get a 'Not Authorized message'. After much testing, and thinking it was a a problem with css/statis resources, I have now found that the problem seems to be with the controller (i.e. a age with no references to css/static resources still fails)
When I get the error, I can login to SF and simply view the apex controller class in the usual Setup - Develop - Classes interface, and the public sites page then works again for another 24-48 hours.
What am I missing here?
http://twitter.com/britishboyindc
Solved! Go to Solution.
Re: Strange Cache Problem
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-28-2012 09:56 PM
Hi,
Have you added cache and expires attribute in <apex:page> tag?
cache : A Boolean value that specifies whether the browser should cache this page. If set to true, the browser caches the page. If not specified, this value defaults to false. For Force.com Sites pages, if this attribute is not specified, this value defaults to true.
expires: The expiration period for the cache attribute in seconds. If the cache attribute is set to true, but this attribute is not specified, this value defaults to zero. For Force.com Sites pages, if cache is not set to false, this value defaults to 600 seconds.
Thanks,
Devendra
Devendra
Re: Strange Cache Problem
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-29-2012 09:33 AM
I have - there is a version of the page setup with caching, and one without - no difference. They both suffer from same issue...
http://twitter.com/britishboyindc
Re: Strange Cache Problem
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
12-11-2012 10:11 AM
In case anyone ends up here, I did finally work this out with help from this post:
http://www.tgerm.com/2010/10/debugging-sites-autho
I set up a debug page, included it as a sites page, and when the page failed, this debug page finally revealed the error.
My controller class has a test method in it, which in turn was referencing a second class - and that class was trying to update a field it wasn't allowed to when running as a Sites user. So for reasons that aren't clear to me, the controller work fine for a while, and the test ran fine, but at some point, it would error out, and I could only fix it by viewing the class while logged in...
I only worked this out by following the link above, and setting up a debug page that I could access as the Sites User, which finally showed me the error - every other debug method provided no information...
http://twitter.com/britishboyindc

