function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BritishBoyinDCBritishBoyinDC 

Cache Problem?

I'm thinking I have an issue with caching but can't work out what it is...I have a Sites page (key code below) that works now, but I know that when I try and access it tomorrow morning, it will throw an 'Authorized Only' error to the person trying to access it via the Sites page.

 

Then, if I sign into SF, I can access the page via the internal /apex/pagename link, and from then on the Sites page also works fine until the next morning, when the problem occurs again. What I am missing?

 

<apex:page standardController="Nomination2__c" extensions="NominationAcceptanceExtension" standardStylesheets="false" showHeader="false" sidebar="false">

  <apex:stylesheet value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css"/>
  <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" />
  <apex:includeScript value="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" />
  
<!--Multi Select Functionality based on this post:
http://www.tgerm.com/2012/01/ipad-multiselect-picklist-jquery-plugin.html
-->
   
  <apex:includeScript value="{!URLFOR($Resource.twinBoxMultiSelectList, 'uiPickList.js')}"/>
  <apex:stylesheet value="{!URLFOR($Resource.twinBoxMultiSelectList, 'uiPickList.css')}"/>


<!--    Additional style sheets stored in VF Components -->
    <c:ACYPlWebCSS />
    <c:NominationACSS />
    
<script type="text/javascript">
       var j$ = jQuery.noConflict();
 
       j$(document).ready(function(){
           j$("#accordion").accordion({ autoHeight: false, collapsible: true });
           
           j$('[id$=travelavail]').twinBoxMultiSelectList({
                            availableList : 'span[id$=availabletravelContactsContainer]',
                            selectedList : 'span[id$=selectedtravelContactsContainer]',
                            styles: {
                                width: '220px'
                            }
                        });
           
              
             j$().css('font-family', 'Verdana,Arial,sans-serif');
             j$('#dialog').hide();
                              
        });
        
        function openlanguages () {
     
                   j$("#dialog").dialog({
                   modal:false,
                   closeable:false,
                   resizeable:false,
                   width:440,
                   overlay: {opacity:0.5, background:"black" },
                   title: 'Language Proficiency'       
                   });
                   
                   }
       
        function closelanguages () {
     
                   j$("#dialog").dialog('close');
                   
                   } 
     </script>    

<title>Nomination Acceptance</title>

    <header id="header" role="banner">
        <div class="upPanel">

=====The rest is just standard VF/HTML====

 

 

Boman@imtBoman@imt

Sure sounds like a caching/stale-cache issue, and am leaning towards putting the blame on those component-alized stylesheets you have. Can you move that CSS into your uiPickList.css file (in resources) and let us know if the issue still occurs?

colemabcolemab

I think the issue is that you are logging in and getting authorized and that allows you access on the public site.  When that times out (sometime over night), you are no longer authorized.

 

I would check that the profile for the public site has access to:

  • The page controller extension and/or any utlized apex class(es)
  • The page itself
  • Any data the classes or page query or display

If it works while you are authorized but doesn't work when you are not, then most likely it has to something to do with the security settings of the profile the site is running under.

 

Please note that you can't access this profile under users but instead from the button on the site detail page.

 

 

colemabcolemab

Also, make sure that any referenced static resources are set to "public".

BritishBoyinDCBritishBoyinDC

So this is still happening, and I set up several test pages with different versions of the code to try and pinpoint the error, including some pages with no css/static resource references - it is indeed something with the code as all versions failed.

 

And here's the thing - if I go to the public sites page, it will at some point give me the error. So I login to SF...if I view the apex controller class, the public sites page then works. 

 

What am I missing here?